From owner-freebsd-bugs Thu Sep 18 22:54:42 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id WAA14597 for bugs-outgoing; Thu, 18 Sep 1997 22:54:42 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [195.8.129.26]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id WAA14583; Thu, 18 Sep 1997 22:54:35 -0700 (PDT) Received: from critter.freebsd.dk (localhost.cybercity.dk [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.7) with ESMTP id HAA12449; Fri, 19 Sep 1997 07:53:53 +0200 (CEST) To: Peter Wemm cc: "Andrew Atrens" , hackers@freebsd.org, gram@cdsec.com, freebsd-bugs@freebsd.org Subject: Re: Bug in malloc/free In-reply-to: Your message of "Fri, 19 Sep 1997 12:59:33 +0800." <199709190459.MAA07378@spinner.dialix.com.au> Date: Fri, 19 Sep 1997 07:53:53 +0200 Message-ID: <12447.874648433@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message <199709190459.MAA07378@spinner.dialix.com.au>, Peter Wemm writes: >> ^Cddd in malloc(): warning: recursive call. >> Virtual memory exceeded in `new' >> >> After reading Graham's thread I relinked it against libgnumalloc, and low >> and behold it works like a charm ! >> >> Does this point to an incompatibility problem between phkmalloc and g++ >> compiled code ? > >Hmm, this particular thing sounds like a signal recursion problem.. > >If a malloc() instance is interrupted in the middle of execution and a >signal is taken, and that signal again calls malloc (eg: via new), the >state of the malloc arena is 'indeterminate'. > >Perhaps malloc is doing something that can cause a signal? or perhaps ddd >has a fast timer that calls malloc (or new) that can interrupt other malloc >calls? Perhaps malloc() could/should block SIGALRM while executing it's >non-reentrant parts? The solution here would be to block signals around malloc/free. This would be rather expensive to do, performance wise, and thus have not been done. It is the responsibility of the application code anyway... If somebody writes the patch to malloc to do this under a option, I'll review and commit, but I don't have the time to do it myself right now. -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop."