From owner-cvs-src@FreeBSD.ORG Sat Oct 29 17:46:57 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19C2216A420; Sat, 29 Oct 2005 17:46:57 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from viefep19-int.chello.at (viefep11-int.chello.at [213.46.255.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9545943D48; Sat, 29 Oct 2005 17:46:55 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at ([213.47.85.26]) by viefep19-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20051029174653.SUZP22340.viefep19-int.chello.at@wombat.fafoe.narf.at>; Sat, 29 Oct 2005 19:46:53 +0200 Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 1D520238; Sat, 29 Oct 2005 19:46:51 +0200 (CEST) Date: Sat, 29 Oct 2005 19:46:50 +0200 From: Stefan Farfeleder To: Bruce Evans Message-ID: <20051029174645.GF21302@wombat.fafoe.narf.at> References: <200510281045.j9SAjJmR096150@repoman.freebsd.org> <200510281033.48001.jhb@freebsd.org> <20051029140403.O30901@delplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051029140403.O30901@delplex.bde.org> User-Agent: Mutt/1.5.11 Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, John Baldwin Subject: Re: cvs commit: src/bin/sh memalloc.c memalloc.h miscbltin.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Oct 2005 17:46:57 -0000 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