-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
json object's creation can freezes execution #231
Comments
Hi @cfoursan, which OS and compiler are you using? |
Hi. Sorry, forget about that information. |
There are known issues with GCC 4.8's C++11 support (see https://github.com/nlohmann/json#supported-compilers). I am not sure whether this could be the reason for this issue, but could you try with a newer version? |
Hi @cfoursan, could you please check again with the most recent could (branch "develop")? |
Hi @nlohmann, I tried on I got std::bad_alloc as expected. So version of GCC could be a reason of this issue. |
I still cannot reproduce the error. Can you provide me with concrete code so I can try? |
@cfoursan Can you provide me with concrete code so I can try? |
Closed due to inactivity. |
I'm sorry for late answer. I tried to reproduce the bug on gcc 4.8. But with no success. That's why let this ticket be closed. If the bug will reproduce I'll let you know. Thanks for fast response! |
Thanks for checking back. I'd love to get rid of all bugs, but you understand I need a way to reproduce it to debug. All the best! |
That's interesting, but I'm using MSVC v140 C++14, and the whole program freezes on this line Inspecting the calling stack, I found out that it came from
I can't provide the minimum repro example at this point as it freezes when calling from another thread and |
When I try create json object and if no memory to allocate there is execution freeze instead of std::bad_alloc.
Gdb trace:
Thread 541 (Thread 0x7fc74f64a700 (LWP 133066)):
#0 0x000000000043cf71 in ZSt3getILm0EIPSt6vectorIN8nlohmann10basic_jsonISt3mapS0_SsblmdSaEESaIS4_EEZNS4_6createIS6_ISt16initializer_listIS4_EEEEPT_DpOT0_EUlS7_E_EENSt11__add_c_refINSt13tuple_elementIXT_ESt5tupleIIDpT0_EEE4typeEE4typeERKSM (__t=empty std::tuple) at /usr/include/c++/4.8/tuple:766
#1 0x000000000043cf9c in _ZNKSt10unique_ptrISt6vectorIN8nlohmann10basic_jsonISt3mapS0_SsblmdSaEESaIS4_EEZNS4_6createIS6_ISt16initializer_listIS4_EEEEPT_DpOT0_EUlPS6_E_E3getEv (this=0x7fc74f648ba0) at /usr/include/c++/4.8/bits/unique_ptr.h:234
#2 0x000000000043a1d1 in nlohmann::basic_json<std::map, std::vector, std::string, bool, long, unsigned long, double, std::allocator>::create<std::vector<nlohmann::basic_json<std::map, std::vector, std::string, bool, long, unsigned long, double, std::allocator>, std::allocator<nlohmann::basic_json<std::map, std::vector, std::string, bool, long, unsigned long, double, std::allocator> > >, std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::string, bool, long, unsigned long, double, std::allocator> > >(std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::string, bool, long, unsigned long, double, std::allocator> >&&) () at ../src/json.hpp:689
#3 0x0000000000437af4 in nlohmann::basic_json<std::map, std::vector, std::string, bool, long, unsigned long, double, std::allocator>::basic_json (this=0x7fc74f648f30, init=..., type_deduction=true, manual_type=nlohmann::basic_json<std::map, std::vector, std::basic_string<char, std::char_traits, std::allocator >, bool, long, unsigned long, double, std::allocator>::array) at ../src/json.hpp:1571
The text was updated successfully, but these errors were encountered: