{"action":"created","issue":{"url":"https://api.github.com/repos/open-source-parsers/jsoncpp/issues/512","repository_url":"https://api.github.com/repos/open-source-parsers/jsoncpp","labels_url":"https://api.github.com/repos/open-source-parsers/jsoncpp/issues/512/labels{/name}","comments_url":"https://api.github.com/repos/open-source-parsers/jsoncpp/issues/512/comments","events_url":"https://api.github.com/repos/open-source-parsers/jsoncpp/issues/512/events","html_url":"https://github.com/open-source-parsers/jsoncpp/issues/512","id":169979791,"number":512,"title":"munmap_chunk(): invalid pointer","user":{"login":"pj1031999","id":10246831,"avatar_url":"https://avatars.githubusercontent.com/u/10246831?v=3","gravatar_id":"","url":"https://api.github.com/users/pj1031999","html_url":"https://github.com/pj1031999","followers_url":"https://api.github.com/users/pj1031999/followers","following_url":"https://api.github.com/users/pj1031999/following{/other_user}","gists_url":"https://api.github.com/users/pj1031999/gists{/gist_id}","starred_url":"https://api.github.com/users/pj1031999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pj1031999/subscriptions","organizations_url":"https://api.github.com/users/pj1031999/orgs","repos_url":"https://api.github.com/users/pj1031999/repos","events_url":"https://api.github.com/users/pj1031999/events{/privacy}","received_events_url":"https://api.github.com/users/pj1031999/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/open-source-parsers/jsoncpp/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-08T17:32:46Z","updated_at":"2016-08-22T10:24:40Z","closed_at":null,"body":"I compile source code with -D_GLIBCXX_DEBUG flag in gcc (GCC) 6.1.1 20160802 I get munmap_chunk() invalid pointer error and program has been aborted.\r\n\r\ngcc flags:\r\n```\r\n-O0 -ggdb -std=c++11 -ljsoncpp -D_GLIBCXX_DEBUG -Wall -Wextra -pedantic\r\n```\r\ncode example:\r\n```c++\r\n#include <json/json.h>\r\n\r\nint main()\r\n{\r\n        Json::Reader r;\r\n        return 0;\r\n}\r\n```\r\n\r\noutput from terminal:\r\n```\r\n*** Error in `./ex': munmap_chunk(): invalid pointer: 0x000000000040198d ***\r\n======= Backtrace: =========\r\n/usr/lib/libc.so.6(+0x70c4b)[0x7f596839fc4b]\r\n/usr/lib/libc.so.6(+0x76fe6)[0x7f59683a5fe6]\r\n./ex[0x4016f4]\r\n./ex[0x401500]\r\n./ex(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_destroyEm+0x44)[0x401226]\r\n./ex(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv+0x36)[0x400eb2]\r\n./ex(_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev+0x18)[0x400d7e]\r\n./ex[0x400d18]\r\n./ex[0x400bc5]\r\n/usr/lib/libc.so.6(__libc_start_main+0xf1)[0x7f596834f291]\r\n./ex[0x400aca]\r\n======= Memory map: ========\r\n00400000-00403000 r-xp 00000000 00:26 1004090                            /tmp/code/jsoncpp/ex\r\n00602000-00603000 r--p 00002000 00:26 1004090                            /tmp/code/jsoncpp/ex\r\n00603000-00604000 rw-p 00003000 00:26 1004090                            /tmp/code/jsoncpp/ex\r\n011f1000-01223000 rw-p 00000000 00:00 0                                  [heap]\r\n7f596832f000-7f59684c4000 r-xp 00000000 fe:02 1969314                    /usr/lib/libc-2.24.so\r\n7f59684c4000-7f59686c3000 ---p 00195000 fe:02 1969314                    /usr/lib/libc-2.24.so\r\n7f59686c3000-7f59686c7000 r--p 00194000 fe:02 1969314                    /usr/lib/libc-2.24.so\r\n7f59686c7000-7f59686c9000 rw-p 00198000 fe:02 1969314                    /usr/lib/libc-2.24.so\r\n7f59686c9000-7f59686cd000 rw-p 00000000 00:00 0 \r\n7f59686cd000-7f59686e3000 r-xp 00000000 fe:02 1987337                    /usr/lib/libgcc_s.so.1\r\n7f59686e3000-7f59688e2000 ---p 00016000 fe:02 1987337                    /usr/lib/libgcc_s.so.1\r\n7f59688e2000-7f59688e3000 r--p 00015000 fe:02 1987337                    /usr/lib/libgcc_s.so.1\r\n7f59688e3000-7f59688e4000 rw-p 00016000 fe:02 1987337                    /usr/lib/libgcc_s.so.1\r\n7f59688e4000-7f59689e7000 r-xp 00000000 fe:02 1969390                    /usr/lib/libm-2.24.so\r\n7f59689e7000-7f5968be6000 ---p 00103000 fe:02 1969390                    /usr/lib/libm-2.24.so\r\n7f5968be6000-7f5968be7000 r--p 00102000 fe:02 1969390                    /usr/lib/libm-2.24.so\r\n7f5968be7000-7f5968be8000 rw-p 00103000 fe:02 1969390                    /usr/lib/libm-2.24.so\r\n7f5968be8000-7f5968d60000 r-xp 00000000 fe:02 1987374                    /usr/lib/libstdc++.so.6.0.22\r\n7f5968d60000-7f5968f60000 ---p 00178000 fe:02 1987374                    /usr/lib/libstdc++.so.6.0.22\r\n7f5968f60000-7f5968f6a000 r--p 00178000 fe:02 1987374                    /usr/lib/libstdc++.so.6.0.22\r\n7f5968f6a000-7f5968f6c000 rw-p 00182000 fe:02 1987374                    /usr/lib/libstdc++.so.6.0.22\r\n7f5968f6c000-7f5968f70000 rw-p 00000000 00:00 0 \r\n7f5968f70000-7f5968fa7000 r-xp 00000000 fe:02 2002351                    /usr/lib/libjsoncpp.so.1.7.4\r\n7f5968fa7000-7f59691a6000 ---p 00037000 fe:02 2002351                    /usr/lib/libjsoncpp.so.1.7.4\r\n7f59691a6000-7f59691a7000 r--p 00036000 fe:02 2002351                    /usr/lib/libjsoncpp.so.1.7.4\r\n7f59691a7000-7f59691a8000 rw-p 00037000 fe:02 2002351                    /usr/lib/libjsoncpp.so.1.7.4\r\n7f59691a8000-7f59691cb000 r-xp 00000000 fe:02 1969313                    /usr/lib/ld-2.24.so\r\n7f596939f000-7f59693a5000 rw-p 00000000 00:00 0 \r\n7f59693c9000-7f59693ca000 rw-p 00000000 00:00 0 \r\n7f59693ca000-7f59693cb000 r--p 00022000 fe:02 1969313                    /usr/lib/ld-2.24.so\r\n7f59693cb000-7f59693cc000 rw-p 00023000 fe:02 1969313                    /usr/lib/ld-2.24.so\r\n7f59693cc000-7f59693cd000 rw-p 00000000 00:00 0 \r\n7fff2d5a0000-7fff2d5c2000 rw-p 00000000 00:00 0                          [stack]\r\n7fff2d5de000-7fff2d5e1000 r--p 00000000 00:00 0                          [vvar]\r\n7fff2d5e1000-7fff2d5e3000 r-xp 00000000 00:00 0                          [vdso]\r\nffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]\r\n[1]    8686 abort (core dumped)  ./ex\r\n```\r\n\r\nbacktrace from gdb:\r\n```\r\n#0  0x00007ffff6f9404f in raise () from /usr/lib/libc.so.6\r\n#1  0x00007ffff6f9547a in abort () from /usr/lib/libc.so.6\r\n#2  0x00007ffff6fd1c50 in __libc_message () from /usr/lib/libc.so.6\r\n#3  0x00007ffff6fd7fe6 in malloc_printerr () from /usr/lib/libc.so.6\r\n#4  0x00000000004016f4 in __gnu_cxx::new_allocator<char>::deallocate (this=0x7fffffffcfd8, __p=0x40198d <__libc_csu_init+77> \"H\\203\\303\\001H9\\335u\\352H\\203\\304\\b[]A\\\\A]A^A_Ðf.\\017\\037\\204\") at /usr/include/c++/6.1.1/ext/new_allocator.h:110\r\n#5  0x0000000000401500 in std::allocator_traits<std::allocator<char> >::deallocate (__a=..., __p=0x40198d <__libc_csu_init+77> \"H\\203\\303\\001H9\\335u\\352H\\203\\304\\b[]A\\\\A]A^A_Ðf.\\017\\037\\204\", __n=0x1) at /usr/include/c++/6.1.1/bits/alloc_traits.h:442\r\n#6  0x0000000000401226 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_destroy (this=0x7fffffffcfd8, __size=0x0) at /usr/include/c++/6.1.1/bits/basic_string.h:186\r\n#7  0x0000000000400eb2 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose (this=0x7fffffffcfd8) at /usr/include/c++/6.1.1/bits/basic_string.h:181\r\n#8  0x0000000000400d7e in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string (this=0x7fffffffcfd8, __in_chrg=<optimized out>) at /usr/include/c++/6.1.1/bits/basic_string.h:558\r\n#9  0x0000000000400d18 in Json::Reader::~Reader (this=0x7fffffffcec0, __in_chrg=<optimized out>) at /usr/include/json/reader.h:33\r\n#10 0x0000000000400bc5 in main () at ex.cpp:5\r\n```\r\n\r\nIt's jsoncpp error or am I doing something wrong?"},"comment":{"url":"https://api.github.com/repos/open-source-parsers/jsoncpp/issues/comments/241372525","html_url":"https://github.com/open-source-parsers/jsoncpp/issues/512#issuecomment-241372525","issue_url":"https://api.github.com/repos/open-source-parsers/jsoncpp/issues/512","id":241372525,"user":{"login":"pj1031999","id":10246831,"avatar_url":"https://avatars.githubusercontent.com/u/10246831?v=3","gravatar_id":"","url":"https://api.github.com/users/pj1031999","html_url":"https://github.com/pj1031999","followers_url":"https://api.github.com/users/pj1031999/followers","following_url":"https://api.github.com/users/pj1031999/following{/other_user}","gists_url":"https://api.github.com/users/pj1031999/gists{/gist_id}","starred_url":"https://api.github.com/users/pj1031999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pj1031999/subscriptions","organizations_url":"https://api.github.com/users/pj1031999/orgs","repos_url":"https://api.github.com/users/pj1031999/repos","events_url":"https://api.github.com/users/pj1031999/events{/privacy}","received_events_url":"https://api.github.com/users/pj1031999/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T10:24:40Z","updated_at":"2016-08-22T10:24:40Z","body":"When I use `std::string` or  `CharReaderBuilder` it's ok."}}
{"actor":{"display_login":"pj1031999"}}