-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Segmentation fault (core dumped) #309
Comments
Just tested this, unable to reproduce. test.cpp #include <iostream>
#include "../src/json.hpp"
using json = nlohmann::json;
int main()
{
json sample;
sample["sensor"] = "name";
sample["position"]["x"] = 10.2;
sample["position"]["y"] = 2.4;
sample["position"]["z"] = 4.5;
std::cout << sample.dump() << std::endl;
return 0;
}
results in:
This is on |
@whackashoe Thanks for your fast reply. My config is My program seemed to run well until now, but as soon as I call sample.dump() from the json lib, then it's Segmentation fault (core dumped), If I don't call That's weird... :( |
Just to clarify, running the code I posted alone works? If so, you likely have memory corruption issues somewhere else. |
Yes, your code works perfectly. Ok, so my problem must be somewhere else. What is strange is that if I don't run |
Can you run your code with Valgrind or Clang's memory sanitizer to make sure it is not a memory corruption? |
I run with Clang msan option |
we are facing the same issue. no probl on ubuntu 14, only on ubuntu 18. it doesn't makes any sense. any more info on how you solved? |
Hello,
If I add this to my code:
the last line
sample.dump()
will throw the error Segmentation fault (core dumped).This is a node c++ addon, which binding.gyp is:
Any help would be much appreciated :)
Many thanks!
The text was updated successfully, but these errors were encountered: