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

free(): invalid pointer error in GCC 5.2.1 #221

Closed
manhnt9 opened this issue Mar 7, 2016 · 2 comments
Closed

free(): invalid pointer error in GCC 5.2.1 #221

manhnt9 opened this issue Mar 7, 2016 · 2 comments
Labels
solution: invalid the issue is not related to the library

Comments

@manhnt9
Copy link

manhnt9 commented Mar 7, 2016

My old code using GCC 4.8.4 works fine. But today I upgrade my system and recompile the code.
It doesn't run anymore and crashes when I retrieve my data.
What should I do to investigate this more?
snapshot1

@nlohmann
Copy link
Owner

nlohmann commented Mar 7, 2016

Can you please create a small code example so I can check? If this is not possible, can you run your code with Valgrind to get better error messages?

The testsuite is also run with Valgrind and does not detect any memory issues. On Travis, one instance runs with GCC 5.3.0.

@manhnt9
Copy link
Author

manhnt9 commented Mar 7, 2016

I resolved the issue, it turned out nothing related to the library at all 😄
The variable I used in assignment was copied by memcpy (using copied non-Plain Old Data so it crashes).
Somehow the old GCC still supports that trick, which made me believe my code was alright.
Thanks for the suggestions and having created the amazing library sir.

@manhnt9 manhnt9 closed this as completed Mar 7, 2016
@nlohmann nlohmann added the solution: invalid the issue is not related to the library label Mar 7, 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

2 participants