Messages in this thread | | | From | "David Schwartz" <> | Subject | RE: Dumb question: Why are exceptions such as SIGSEGV not logged | Date | Tue, 19 Aug 2003 13:01:26 -0700 |
| |
> Correction... > > _exit(2). > > There is no exit(2); I was talking about _exit(2) and you're talking > about exit(3). > > _exit(2) *is* guaranteed to terminate a process immediately. > > -hpa
If only it was so! I have direct practical experience that under LinuxThreads, at least, it doesn't. SuSv3 allows _exit to flush open streams and remove temporary files. Sadly, _exit, on many systems, acquire locks or accesses process structures that might be corrupt whereas dereferencing a NULL pointer does not.
I have portable code that has a 'terminate this process immediately' function. It started out calling '_exit' until we found platforms where that resulted in a hang (say the thread calling _exit holds a non-recursive mutex that the _exit function tries to acquire). So we kept inching our way up to more and more extreme termination methods.
DS
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |