RE: Dumb question: Why are exceptions such as SIGSEGV not logged
From: David Schwartz
Date: Mon Aug 18 2003 - 04:18:37 EST
> Valdis.Kletnieks@xxxxxx wrote:
> > Consider this code:
> >
> > char *foo = 0;
> > sigset(SIGSEGV,SIG_IGNORE);
> > for(;;) { *foo = '\5'; }
> >
> > Your logfiles just got DoS'ed....
> Why not then just log uncaught exceptions?
Because deliberately creating an uncaught exception is a perfectly sane,
reasonable thing to do with well-defined semantics. Applications should feel
free to do such reasonable things without getting complaints from the system
administrator that their log is being flooded with garbage.
There is no mechanism that is guaranteed to terminate a process other than
sending yourself an exception that is not caught. So in cases where you must
guarantee that your process terminates, it is perfectly reasonable to send
yourself a SIGILL.
FreeBSD logs any number of normal things that sane, reasonable processes do
and it's very annoying. A very annoying example is FreeBSD's desire to log
calls to 'wait' functions with 'SIGCHLD' ignored. How else can portable
programs say, "I want you to automatically reap my zombies if you can, but
otherwise, I'll reap them if needed by calling waitpid(WNOHANG) every once
in a while".
DS
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/