Skip to content
Advertisement

Debugging a linux daemon process written in C

On occasion a daemon I wrote in C gets these error messages:

JavaScript

My question is how can I examine that address in libc-2.19.so to see which function is being called when the error occurs? I tried using gdb

but I get :

JavaScript

Advertisement

Answer

With the data you provide there’s very little that can be done here to make a diagnose on your problem. What I can infer is that the address, being 0, points to a NULL dereference in your code (you pass NULL as the pointer to a string address, or something similar, that makes your printf() call to fail — or similar, again) The address 0x1a7000 is where, in libc has been raised the exception. You probably can guess the function name, by executing nm(1) to your libc.so.xx.xx.xx. Dumping a core (by setting ulimit -c unlimited before executing your daemon) will allow to use the postmortem debugger. Or perhaps the source code of the daemon would help also. Sorry but your question is far from complete to be able to help. See How to create a Minimal, Complete, and Verifiable example for more information.

Advertisement