Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Sep 1997 12:58:34 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        mike@smith.net.au, atrens@nortel.ca, freebsd-bugs@freebsd.org, gram@cdsec.com, hackers@freebsd.org, julian@whistle.com
Subject:   Re: Bug in malloc/free 
Message-ID:  <13264.874666714@critter.freebsd.dk>
In-Reply-To: Your message of "Fri, 19 Sep 1997 19:54:38 %2B1000." <199709190954.TAA11275@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <199709190954.TAA11275@godzilla.zeta.org.au>, Bruce Evans writes:
>>>> probably a printf or other stdio function
>>>
>>>I *know* this. 8) I'm just trying to find the sucker.  The 'ddd' example 
>>>looked like it was spinning in abort(), which doesn't look like it will
>>>actually come back and call malloc() again.  In olden days, 
>>...
>>Some time ago abort() was changed to that it would call __flush(),
>>because some standard said so.  I still think this is unwise.
>
>Standard C says that whether streams are flushed by abort() is
>implementation-defined.  POSIX says that abort() shall have the effects
>of fclose() if abort() causes process termination, but shall have no
>effects otherwise.  Our implementation doesn't quite confirm to this,
>since the effects of flushing can be detected:
>1. setvbuf() to unbuffered and size 2, then putc() 1 byte, then _exit().
>   I think it is guaranteed that 0 bytes are written.
>2. As in (1), but set up a SIGABRT handler so that abort() doesn't cause
>   termination, and call abort() before _exit().
>
>Flushing in abort() should be safe because abort() is not among the
>functions that are safe to call from a signal handler :-).

Bummer.

So what should I do in malloc when I realize that continuing doesn't
make sense ?

	kill (diesig, getpid()); ?
	for which value of diesig ?


--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?13264.874666714>