简体   繁体   中英

Bug in libc? How to read dump file?

I will try to ask my question in the best way I can:

I want to use example code (only one file called "main.cpp") from a camera manufacturer to read images from my camera under Ubuntu 11.10. If I use the example project, everything works fine and I receive image data. But if I add this "main.cpp" to my real project and compile, the application crashes.

It's very hard to determine the part which causes this error. But if I remove some code from me (which is compiled but definitly NOT used!), the program works as expected. I guess there is an error caused by another library I am linking against when my code is being compiled (eg Opencv or boost?). Im trying to figure out which part causes this behavior, but I would be glad if you guys could tell me in the mean time, if it's possible to extract useful information from this crash message which can be found on this Gist .

Is my libc damaged?

Bug in libc?

No.

*** glibc detected *** ./myProject: double free or corruption (!prev): 0x09c12660 ***

This error means that your application corrupted heap in some way. It may have free ed the same pointer twice, or it may have written past the end of allocated buffer.

The tool to find such heap corruption bugs is Valgrind .

The fact that the crash happens only when you link in extra code is likely just an accident -- the bug is probably present in the application even without the extra code, but has not yet manifested in a crash.

It's also possible, though less likely, that the extra code introduces the bug.

In either case, once you run the application under Valgrind, the error should become obvious.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM