Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Sep 1998 01:59:59 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        HighWind Software Information <info@highwind.com>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: free() called recursively 
Message-ID:  <199809080100.CAA03464@woof.lan.awfulhak.org>
In-Reply-To: Your message of "Mon, 07 Sep 1998 16:29:18 EDT." <199809072029.QAA03642@highwind.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> How bad is it to get this:
> 	"t_activefile in free(): warning: recursive call."

Very.

> We are using gcc for C++. One of our test programs which tests code
> that currently sends our application out into "la-la land" seems to
> print this every few runs. During those runs, it also goes off into
> "la-la land".
> 
> "la-la land" == running but going nowhere. ktrace shows nothing,
> application only dies with "kill -9".
> 
> We do link against libc_r. I'm wondering if this recursive call thing
> is a serious problem and what we can do about it.
> 
> -Rob

It's *usually* (sometimes?) caused by code that does complicated 
things in frequently called signal handlers - perhaps a SIGALRM 
handler.  It *may* happen because of something as simple as a 
printf() in a SIGUSR1 if the signal happens during a malloc()/free() 
and printf() feels inclined to do a malloc() or free().

If your program uses frequent signals, you should probably defer the 
processing 'till after the return of the signal handler to avoid 
these problems.  An example can be found in src/usr.sbin/ppp/sig.c.

-- 
Brian <brian@Awfulhak.org>, <brian@FreeBSD.org>, <brian@OpenBSD.org>
      <http://www.Awfulhak.org>;
Don't _EVER_ lose your sense of humour....



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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