Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGFAULT on arm target #1190

Closed
susundberg opened this issue Aug 8, 2018 · 2 comments
Closed

SEGFAULT on arm target #1190

susundberg opened this issue Aug 8, 2018 · 2 comments
Labels
platform: arm related to ARM architecture state: help needed the issue needs help to proceed state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated

Comments

@susundberg
Copy link

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.

@nlohmann nlohmann added platform: arm related to ARM architecture state: help needed the issue needs help to proceed labels Aug 9, 2018
@nlohmann
Copy link
Owner

This is really strange...

@stale
Copy link

stale bot commented Sep 14, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated label Sep 14, 2018
@stale stale bot closed this as completed Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: arm related to ARM architecture state: help needed the issue needs help to proceed state: stale the issue has not been updated in a while and will be closed automatically soon unless it is updated
Projects
None yet
Development

No branches or pull requests

2 participants