Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 1998 23:13:33 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Greg Lehey <grog@lemis.com>
Cc:        Mike Smith <mike@smith.net.au>, FreeBSD current users <FreeBSD-current@FreeBSD.ORG>
Subject:   Re: Memory leak in inetd in last week's -current? 
Message-ID:  <676.890259213@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 19 Mar 1998 08:20:33 %2B1030." <19980319082033.12206@freebie.lemis.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

>> Wrong.
>>
>> It says "too >high< to make sense".
>>
>> Likely causes:
>>
>> 	pointer to a stack item
>> 	pointer to a previously free'ed piece of memory.
>> 	pointer to mmaped memory, for instance shlib data
>> 	uninitialized pointer.
>>
>> Technically it means that the pointer is higher than sbrk(0).
>
>Now *that*'s the kind of information which makes sense to me.
>
>OK, that looks like a program logic bug, not the results of loss of
>swap space (of which I should have always had at least 80 MB over).
>Any ideas about how to look for this particular needle in a haystack?

You can try to set the AJ options to malloc system wide (see malloc(3)),
and see if that makes inetd behave differently.  This is the easy thing 
to do.  ("J" costs some performance loss).  You may want to make sure 
that filedescriptor #2 is open to a file somewhere, since that is where
malloc will write diagnostics.

Doing it by code inspection should also be easy in this case:  the
message comes after the fork, and after filedescriptor #2 has been
associated with the socket.  Look at the code after that point and
try to find direct calls to free() or indirect ones (fclose ?)

If you can reproduce it, run it under a debugger...

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
"Drink MONO-tonic, it goes down but it will NEVER come back up!"

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?676.890259213>