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

crash in dump #370

Closed
user1095108 opened this issue Nov 26, 2016 · 8 comments
Closed

crash in dump #370

user1095108 opened this issue Nov 26, 2016 · 8 comments
Labels
solution: invalid the issue is not related to the library

Comments

@user1095108
Copy link

No description provided.

@user1095108
Copy link
Author

operator<<

#0 0x7fe9fadcdb0f in __dynamic_cast /build/gcc/src/gcc/libstdc++-v3/libsupc++/dyncast.cc:95
#1 0x7fe9fae00d4c in std::locale::facet::_M_cow_shim(std::locale::id const*) const /build/gcc/src/gcc/libstdc++-v3/src/c++11/cxx11-shim_facets.cc:792
#2 0x7fe9fade1a2b in std::locale::_Impl::_M_install_facet(std::locale::id const*, std::locale::facet const*) /build/gcc/src/gcc/libstdc++-v3/src/c++98/locale.cc:384
#3 0x4a9b26 in locale<nlohmann::(anonymous namespace)::DecimalSeparator> /usr/include/c++/6.2.1/bits/locale_classes.tcc:50
#4 0x4ab19b in nlohmann::operator<<(std::ostream&, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator> const&) json/src/json.hpp:5832

dump()

#0 0x7f7a88ec9b0f in __dynamic_cast /build/gcc/src/gcc/libstdc++-v3/libsupc++/dyncast.cc:95
#1 0x7f7a88efcd4c in std::locale::facet::_M_cow_shim(std::locale::id const*) const /build/gcc/src/gcc/libstdc++-v3/src/c++11/cxx11-shim_facets.cc:792
#2 0x7f7a88edda2b in std::locale::_Impl::_M_install_facet(std::locale::id const*, std::locale::facet const*) /build/gcc/src/gcc/libstdc++-v3/src/c++98/locale.cc:384
#3 0x413026 in locale<nlohmann::(anonymous namespace)::DecimalSeparator> /usr/include/c++/6.2.1/bits/locale_classes.tcc:50
#4 0x4262aa in nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, unsigned long, double, std::allocator>::dump(int) const json/src/json.hpp:2204

@nlohmann
Copy link
Owner

Can you give more information:

  • What input did you want to serialize?
  • What system (OS, compiler) are you using?

@user1095108
Copy link
Author

Linux i7-2720QM 4.8.10-1-ARCH #1 SMP PREEMPT Mon Nov 21 11:55:43 CET 2016 x86_64 GNU/Linux

It's just basic stuff, basically there's a crash with anything you do

json j;
j["something"] = 10;
::std::cout << j << ::std::endl;

gcc version 6.2.1 20160830 (GCC)
and c++1z flag

@user1095108
Copy link
Author

==3109==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7ff28bfd3b10 bp 0x7ffdd5df5930 sp 0x7ffdd5df58c0 T0)

@TurpentineDistillery
Copy link

  • Did you make the call from a destructor of a static object, by any chance?
  • Does using the code from the latest develop branch fix the issue for you? (it does not use DecimalSeparator, which appears in the stack trace)

@user1095108
Copy link
Author

no, it's a plain vanilla test from main(), no static functions or destructors are involved.
I'm using the latest and greatest json i.e. git checkout master

@user1095108
Copy link
Author

wow, switching to the develop branch fixed the issue, way to go hehe. I'd think the develop branch would be the most unstable one :)

@nlohmann
Copy link
Owner

There have been a lot of fixes lately, and master contains the previous release (which was thought to be stable ;)).

@nlohmann nlohmann added the solution: invalid the issue is not related to the library label Nov 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: invalid the issue is not related to the library
Projects
None yet
Development

No branches or pull requests

3 participants