I developed a simple wrapper that encapsulates a JSONObject with Boost Property trees. The problem is a segmentation fault in this code:
void JSONObject::parse(const std::string &text)
{
std::istringstream ss(text);
boost::property_tree::read_json(ss, *pt);
}
A bit of context, I am using JSON for message serialization. If the program uses only one thread it works without problems. But if the program uses two threads in gives a segmentation fault in the last line of the above code.
Each thread has its own JSONObject object and none of the variables are shared between the threads. My idea is that maybe the stream is not thread safe internally.
Can anyone help me?