0

I'm trying to find a bug in a linux-daemon written in C. The daemon is supposed to run in an endless loop answering requests. Once in a while it just stops for no apparent reason. No coredump is created. No kernel-segfault message is written to /var/log/messages

We already know that the death of the process is caused by certain requests but I cannot find the location within the source where the bug happens.

Here's what I did so far:

  • recompile with -g -Wall, start with ulimit -c unlimited
  • kill with -ABRT, this will create a coredump so permissions must be ok
  • added char *p=NULL, c=*p; somewhere to the code. this creates both a coredump and a kern.info segfault syslog-message. And gdb a.out core shows a perfect backtrace

This all makes me believe, that the problem is not caused by a wrong pointer. Every exit()-statement is preceeded by syslog()-statements, so it's not the process that stops itself. And there are no users on this system that might kill the process.

What else might kill a unix process without a coredump ???

Peter

1 Answers1

1

The default handler of some signal.

If this is a daemon, it probably handles some network communications. By default, socket operations may raise SIG_PIPE signals. The default handler just exits the program.

Make sure you ignore SIG_PIPE.

bltxd
  • 8,825
  • 5
  • 30
  • 44