cvs commit: src/bin/sh memalloc.c memalloc.h miscbltin.c

Stefan Farfeleder stefan at fafoe.narf.at
Sat Oct 29 10:46:57 PDT 2005


On Sat, Oct 29, 2005 at 02:29:55PM +1000, Bruce Evans wrote:
> On Fri, 28 Oct 2005, John Baldwin wrote:
> 
> >On Friday 28 October 2005 06:45 am, Stefan Farfeleder wrote:
> >>stefanf     2005-10-28 10:45:19 UTC
> >>
> >>  FreeBSD src repository
> >>
> >>  Modified files:
> >>    bin/sh               memalloc.c memalloc.h miscbltin.c
> >>  Log:
> >>  Protect malloc, realloc and free calls with INT{ON,OFF} directly in
> >>chkalloc, ckrealloc and ckfree (added), respectively.  sh jumps out of the
> >>signal handler using longjmp which is obviously a bad idea during malloc
> >>calls.
> >>
> >>  Note: I think there is still a small race here because volatile
> >>sig_atomic_t only guarantees atomic reads and writes while we're doing
> >>increments and decrements.
> 
> Stefan should know that only atomic writes are guaranteed, but there seems
> to be no problem in practice since the inc/dec is not done in signal 
> handlers

Yes, after some more thinking I agree that the current code is fine.

Stefan


More information about the cvs-src mailing list