Re: SIGSEGV on fclose

From: Andi Kleen (ak@suse.de)
Date: Thu Jul 13 2000 - 11:14:48 EST


On Thu, Jul 13, 2000 at 08:51:48AM -0700, Ulrich Drepper wrote:
> Manfred Spraul <manfred@colorfullife.com> writes:
>
> > I assume that the other unices store a magic number within the stream
> > structure, but that's ugly and doesn't guarantee an error message: you
> > replace a 100% sigsegv with a rare race - I prefer the sigsegv.
>
> Can we all stop this nonsense now. Manfred's comment summarizes the
> situation pretty well. One of the basic design rules of glibc is to
> crash early whenever something is wrong since all workarounds (like in
> this case) never have a 100% chance to survive.

The original poster passed it a NULL pointer though, not a random pointer.
It would be certainly reasonable to check for NULL pointer in fclose,
similar to free()

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:17 EST