* Question on "Third Degree"
@ 1999-01-05 5:00 core__dump
1999-01-05 5:00 ` Jarkko Hietaniemi
0 siblings, 1 reply; 2+ messages in thread
From: core__dump @ 1999-01-05 5:00 UTC (permalink / raw)
When I run Third Degree on a simple program that contains a call
to "fopen" on a Digital UNIX V4.0B (Rev. 564) machine, Third Degree
reports a memory leak.
Here is the test program:
#include <stdio.h>
main()
{
FILE *fd;
if( (fd = fopen("test.txt","w")) == NULL) {
perror("Error with fopen:");
exit(1);
}
fclose(fd);
}
Commands I used to build and execute the test program:
cc -o testprog testprog.c
atom testprog -tool third -all
setenv LD_LIBRARY_PATH ./
testprog.third
Here is the contents of the Third Degree log file:
Third Degree version 4.2
testprog.third run by root on f22a, Wed Dec 30 11:25:49 1998
No .third or //.third file found.
------------------------------------------------------------------------
------------------------------------------------------------------------
Searching for new leaks in heap after program exit
48 bytes in 1 leak (including 1 super leak) created at:
malloc libc.so
_findiop libc.so
fopen libc.so
main testprog
__start testprog
------------------------------------------------------------------------
------------------------------------------------------------------------
memory layout at program exit
heap 57344 bytes [0x140002000-0x140010000]
stack 1328 bytes [0x11ffffad0-0x120000000]
testprog data 8192 bytes [0x140000000-0x140002000]
/usr/shlib/libc.so data 105296 bytes [0x3ffc0800000-0x3ffc0819b50]
testprog text 393216 bytes [0x120000000-0x120060000]
/usr/shlib/libc.so text 2686976 bytes [0x3ff80800000-0x3ff80a90000]
Is there really a memory leak within "fopen"?
Thanks
DM
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Question on "Third Degree"
1999-01-05 5:00 Question on "Third Degree" core__dump
@ 1999-01-05 5:00 ` Jarkko Hietaniemi
0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Hietaniemi @ 1999-01-05 5:00 UTC (permalink / raw)
core__dump@my-dejanews.com writes:
> [snip]
> Searching for new leaks in heap after program exit
>
> 48 bytes in 1 leak (including 1 super leak) created at:
> malloc libc.so
> _findiop libc.so
> fopen libc.so
> main testprog
> __start testprog
> [snip]
> Is there really a memory leak within "fopen"?
It's perfectly possible. But:
(1) because it's within libc you cannot directly do anything about it
(indirectly you can complain to Digital UNIX product support)
(2) Whether it's a "real" leak is debatable. Do 1000 fopens and if
you leak 48000 bytes, then you should get worried and complain really
loudly. But if the leak stays small regardless of the number of
fopens, don't fret over it, it's most probably just some small working
area that libc stdio allocates.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-01-05 5:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-01-05 5:00 Question on "Third Degree" core__dump
1999-01-05 5:00 ` Jarkko Hietaniemi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox