mymap.emplace(newstring, newvector); // sometimes get segfaults here
later I add the pointers after allocating memory for them
uint8_t *newpointer = new uint8_t[50];
uint8_t *otherpointer = new uint8_t[75];
(mymap[newstring]).push_back(newpointer); // sometimes get segfaults here
(mymap[newstring]).push_back(otherpointer);
Not sure why...In the debugger the segfault happens when emplace looks to see if the string I'm passing is unique such that string is being compare to an empty string
You aren't posting the actual code you use or the context in which that code appears, so your description is fairly useless for the purposes of determining what is happening to give you the results you're getting.
Distill your code down to a reasonably sized compilable snippet that reproduces the problem you are experiencing. Post it here or in a new thread along with as much information as you can supply.
Yep sorry wasn't at home...here's the code. This is a testbench that allocates memory for a byte array, writes it to memory, they uses the map to keep track of the pointers to the array so they can be deleted as each part finishes so that memory can be recovered. I can't use a shared pointer because I'm writing the address and size into a software ring that hardware will then read to retrieve the information.
// issue packet to software ring
void jproducer::issue(std::shared_ptr<jpacket>& packet) {
// pointers for data
std::shared_ptr<jarray<uint8_t>> myin;
// retrieve the data from the packet
packet->get_input(myin);
// write data to memory
uint64_t iaddr;
uint64_t oaddr;
// tracking for memory
std::vector<uint8_t*> tmp(0);
m_mmu->emplace(packet->get_name(), tmp);
// write data to memory
iaddr = write(packet->get_name(), myin->get_ptr(), myin->get_size());
// write data to memory
oaddr = get_mem(packet->get_name(), packet->get_outlen());
packet->set_outaddr(oaddr);