Skip to content

Segfault on construction of class using json in a multi threaded application #1107

Open
@Levi-Armstrong

Description

@Levi-Armstrong

Describe the bug
Segfault on construction of class using json in a multi threaded application.

gdb output:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe99a535f in ?? () from /usr/lib/x86_64-linux-gnu/libjsoncpp.so.1
(gdb) bt
#0  0x00007fffe99a535f in ?? () from /usr/lib/x86_64-linux-gnu/libjsoncpp.so.1
#1  0x00007ffff7de5733 in call_init (env=0x7fffffffd3e8, argv=0x7fffffffd3d8, argc=1, l=<optimized out>) at dl-init.c:72
#2  _dl_init (main_map=0x7ffff7ffe170, argc=1, argv=0x7fffffffd3d8, env=0x7fffffffd3e8) at dl-init.c:119
#3  0x00007ffff7dd60ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#4  0x0000000000000001 in ?? ()
#5  0x00007fffffffd7eb in ?? ()
#6  0x0000000000000000 in ?? ()

If I remove the following lines of code the issue goes away.

#if JSON_USE_NULLREF
// for backwards compatibility, we'll leave these global references around, but
// DO NOT use them in JSONCPP library code any more!
// static
Value const& Value::null = Value::nullSingleton();

// static
Value const& Value::nullRef = Value::nullSingleton();
#endif

To Reproduce
Steps to reproduce the behavior:

  1. I will work on a test case but I have been able to reproduce on multiple machines.

Desktop (please complete the following information):

  • Ubuntu 18.04.3 LTS
  • Intel® Core™ i7-4700MQ CPU @ 2.40GHz × 8
  • Quadro K1100M/PCIe/SSE2
  • GNOME 3.28.2
  • 64-bit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions