I am trying to run a C++ program developed on Ubuntu 18.04. It uses JSON-C shared library. It compiles and runs without any problem on my Ubuntu 18.04 system. However it compiles on a Ubuntu 14.04 system but crash upon running, Reporting following message -
*** Error in `./main.out': corrupted size vs. prev_size: 0x00007fdd54f49e30 ***Aborted (core dumped)
After some digging I have found that something wrong with JSON-C library. I have checked the linked JSON-C libraries using ldd command. It gave me following output in Ubuntu 18.04 -
libjson-c.so.3 => /lib/x86_64-linux-gnu/libjson-c.so.3 (0x00007ff16a88c000)
And following in Ubuntu 14.04 -
libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f0848838000)
I guess something wrong with JSON-C versions. I couldn't found any useful information on google. Any ideas what sort of problem this is?
Ubuntu 18.04 LTS includes a newer version of the library "libjson-c3". Previous versions, including Ubuntu 16.04 LTS and 14.04 LTS have an older version "libjson-c2".
These versions are different enough that they're incompatible.
If you must run your code on 14.04, you'll need to scrutinize the libjson calls to figure out where these compatibilities are.
Alternatively, you could try to run your application on newer 18.04, and not worry about supporting 14.04