Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Oct 2005 19:46:50 +0200
From:      Stefan Farfeleder <stefan@fafoe.narf.at>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, John Baldwin <jhb@freebsd.org>
Subject:   Re: cvs commit: src/bin/sh memalloc.c memalloc.h miscbltin.c
Message-ID:  <20051029174645.GF21302@wombat.fafoe.narf.at>
In-Reply-To: <20051029140403.O30901@delplex.bde.org>
References:  <200510281045.j9SAjJmR096150@repoman.freebsd.org> <200510281033.48001.jhb@freebsd.org> <20051029140403.O30901@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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