jsoncpp icon indicating copy to clipboard operation
jsoncpp copied to clipboard

Crash on Android build

Open smilejimin opened this issue 8 years ago • 2 comments

Hi,

I compiled jsoncpp for android by using android ndk r14 toolchain, which use g++ 4.9 android compiler to use it in native space(on x86_64). However whenever the Reader class is out of scope(either class is deleted, or local function ends), the system crashes complaining no destructor to call.

Json::Reader reader;
Json::Value value; 
std::ifstream stream(label_file.c_str()); 
reader.parse(stream, value); 

==> Crash seen on "Json::Reader::~Reader()+238"

So, I tried instead of using reader, but use parseFromStream() global api to use CharReader

Json::CharReaderBuilder builder;
  builder["collectComments"] = false;
  std::string errs;
  bool ok = parseFromStream(builder, stream, &value, &errs);

=> Crash seen on Json::OurCharReader::parse(char const*, char const*, Json::Value*, std::string*)+173)

Any recommendation how to fix this?

smilejimin avatar Jun 04 '18 19:06 smilejimin

Not sure. We could definitely use your help. Stack-trace?

cdunn2001 avatar Jun 22 '18 16:06 cdunn2001

Closing due to inactivity. Please feel free to comment/reopen if we have more information.

baylesj avatar Jun 25 '19 22:06 baylesj