🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #115

Make calls free during call to malloc

#115
From: Skip Montanaro
Date: Wed, 08 Apr 1992 13:11
30 lines
1875 bytes
In the course of trying to identify some problems I am having executing
parallel actions (Make's -jN flag) on Silicon Graphics machines, I took the
opportunity to try out Purify on the Sun-4 version of make. It noticed that
free() was being called during a call to malloc. This occurs when a job
completes and the data structures for the child process are freed. Here is
an example traceback:

    Warning: calling free(1080696) while in a call
     to malloc/free/memalign.  Probably from a signal handler. 
     malloc/free/memalign are *not* reentrant and this may
     cause a later segv.
    This is occurring while in:
		 free_child (sun4_job.o; pc = 0x11a74)
		 child_handler (sun4_job.o; pc = 0x117e8)
		 _sigtramp (<shared library>; pc = 0xf7504c8c)
		 sbrk (purify.o; pc = 0x2b14)
		 ReAlLoC (<shared library>; pc = 0xf7507a94)
		 MaLlOc (<shared library>; pc = 0xf7507330)

The funny capitalization of malloc and realloc are Purify's doing. They are
the usual Sun versions of those functions. The sun4_job.o is also Purify's
work. It is really job.o.

I believe to correct this problem the best that can be done is to mark the
child's data structures as freeable and wait until later to free them.

I have no idea if this is the cause of my SGI problem, but I thought those
with the know-how and/or interest might want to look into this problem.

Skip (montanaro@crd.ge.com)
Technical Details
Message-ID: <9204081311.AA18434@moose.crd.Ge.Com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!moose.CRd.ge.COM!montnaro

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!moose.CRd.ge.COM!montnaro
From: montnaro@moose.CRd.ge.COM (Skip Montanaro)
Subject: Make calls free during call to malloc
Message-ID: <9204081311.AA18434@moose.crd.Ge.Com>
Sender: gnulists@ai.mit.edu
Reply-To: montanaro@crd.ge.com (Skip Montanaro)
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 8 Apr 1992 13:11:11 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 31