-
Notifications
You must be signed in to change notification settings - Fork 11
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
MAC OS X malloc issue pointer being freed was not allocated #21
Comments
I don't have a Mac dev setup yet. I am not able to reproduce this behavior on Linux. I get the following by running the above code. input = ["{"msg":"connect","session":"pjwLzc25gD","version":"1","support":["1","pre2","pre1"]}"] I ran the code via valgrind. I get the following suggesting there wasn't a malloc issue. ==20701== HEAP SUMMARY: I am trying to get a Mac setup. |
I got a Mac. Can you tell me about your compiler setup do I can replicate it? |
g++-5 (Homebrew gcc 5.2.0) 5.2.0 CXX_FLAGS=-m32 (jvar built 32bit also) |
I got my dev environment setup and making sure jvar works on macs. I install brew and gcc... But it didn't install gcc version you mentioned. I fixed a few compile issue... One in particular was an error where it failed to find ~string()... I wonder if that is related. I ended up replacing it with ~basic_string() even though ~string should work. After that your test code above runs perfectly with no issues. There are also zero issues shown in valgrind. I don't know if you ran into the string issue or not. |
clang is not gcc actually |
Here is my valgrind report, maybe it will help:
|
Yeah I realized that. I did install GCC from Brew but for some reason it is aliasing to CLANG. Once I figure out how to use proper version of GCC, I will fix this issue. BTW: Here is some discussion about the CLANG bug regarding ~string() vs GCC From: dk547 notifications@github.com clang is not gcc actually Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-168359762. |
OK. Here is the latest status on Mac:
|
Got to the bottom of the issue. And it is not good news. This is breaking because of a change in the ABI in GCC 5.x. The new default ABI for libstd++ is C++11/14... which is not compatible with the older ABI. I regret the decision to depend on std::string now and this reaffirm my feeling toward STL in general. CONCLUSION: JVAR is currently not compatible with GCC 5 due to the change in ABI. I will continue investigating how it can be fixed--but I don't know the ETA for a fix. But in the mean time, if you need to use this library please use GCC-4.8 or Clang. |
This has been fixed. |
Here is the test code:
I get following error when I try to run it:
$ ./a.out
input = ["{"msg":"connect","session":"pjwLzc25gD","version":"1","support":["1","pre2","pre1"]}"]
msg = conn�O�
a.out(15642,0x7fff7be5f300) malloc: *** error for object 0x7fdd18c04dcc: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
The text was updated successfully, but these errors were encountered: