I know there have been similar questions about that topic, but I think mine differs from the others. I have this application which I am able to crash, but the error seems to happen inside of a shared object library, which gets loaded by the application. So my question is, how do I proceed further? I attached the application to GDB and let the application crash. But how could I find out if the error relies in the library?


You can't. For example, if you call a printf() with a NULL as format string, you will get a segfault in the libc, although it won't be a libc error.

But you can be nearly sure, that the shared library doesn't checks some of the data structures it gets from the main program (or from another dlls). C libraries doesn't need to do that (normally).

And if something isn't checked against NULL-pointer dereference, probably it wasn't checked also against buffer overrun. And such errors are mostly caused be NULL-dereference. You should always check on the asm-level (even with the gdb), what caused the crash, and to make an assumption, what were it on the C level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.