-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Hi!
Thanks for the great library! I am using it in my project in two ways: 1) read json files and 2) produce json output (to be delivered later over websocket to a browser).
The issue happens only in embedded target (rasperry pi3) and it happens always. But to make things very weird, it goes away by adding some extra code before the call (later). Unfortunately valgrind refuses to run the program due open_ssl_setup calling invalid opcodes, and on my host (x64) the program runs fine, no valgrind errors shown. I do get coredumps, and below is attached GDB bt on the issue.
The program it single threaded, so it should not be concurrency issue. The call is inside dbus call, that does not make things easier, but should not raise raise conditions as far as i known
I was able to get a "workaround" by removing the line 105 and similar and making the keys at the declaration time. Also - like i wrote above - adding some debug code makes the issue to disappear - see (debug_patch.00). If that call is added on another dbus call before the segfaulting, the original call goes just fine. Patch has several calls on the code, but even one is enough.
gdb_on_core.txt
original_code.txt
debug_patch.txt
I am not saying there is a bug, but more of asking would somebody have idea what is causing this?
Version: 3.3.2. From GDB trace the fail goes via
// at only works for objects
if (JSON_LIKELY(is_object()))
{
return m_value.object->operator[](key);
}
Compiler is:
arm-buildroot-linux-gnueabihf-g++.br_real (Buildroot 2017.02.9) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.