Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* third and pthread
@ 1999-02-08  5:00 Jean-Damien DURAND
  1999-02-08  5:00 ` Chris Forrest
  1999-02-15  5:00 ` John P Williams
  0 siblings, 2 replies; 3+ messages in thread
From: Jean-Damien DURAND @ 1999-02-08  5:00 UTC (permalink / raw)



  Dear all,

  Would someone in here please explain me why, when compiling the following
so-simple program:

int main () {
  exit(0);
}

  with -pthread option, and intrumenting it with "third -env threads";

[dxplus05] ~ % cc -pthread -o ./testit ./test.c
[dxplus05] ~ % atom -tool third -env threads testit

  I have the following in the 3log file:

------------------------------------------------------------------------
Searching for new leaks in heap after program exit


Warning: 367 pointers to heap objects with read access disabled were skipped

A total of 122192 bytes in 226 leaks were found:

90112 bytes in 3 leaks created at:
    __valloc                       libc.so
    -----                          -----
    -----                          -----
    -----                          -----

28000 bytes in 221 leaks (including 3 super leaks) created at:
    malloc                         libc.so
    -----                          -----
    -----                          -----
    -----                          -----

2040 bytes in 1 leak (including 1 super leak) created at:
    calloc                         libc.so
    pc = 0x3ff809523ec             libc.so
    pc = 0x3ff808efc9c             libc.so
    __init_libc                    libc.so

2040 bytes in 1 leak created at:
    calloc                         libc.so
    pc = 0x3ff809523d0             libc.so
    pc = 0x3ff808efc9c             libc.so
    __init_libc                    libc.so

------------------------------------------------------------------------

  What misunderstanding or mistake am I doing ? Thanks a lot for any advice...

  Cheers,                          Jean-Damien.

FYI:
[dxplus05] ~ % uname -a 
OSF1 dxplus05 V4.0 564 alpha
[dxplus05] ~ % what `which atom` | tail -1
        $RCSfile: strerror.c,v $ $Revision: 4.2.8.3 $ (DEC) $Date: 1994/04/05 15:48:37 $
--
       *******************************************************
       *      Jean-Damien Durand (jdurand@mail.cern.ch)      *
       *        www : http://wwwinfo.cern.ch/~jdurand/       *
       *******************************************************



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: third and pthread
  1999-02-08  5:00 third and pthread Jean-Damien DURAND
@ 1999-02-08  5:00 ` Chris Forrest
  1999-02-15  5:00 ` John P Williams
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Forrest @ 1999-02-08  5:00 UTC (permalink / raw)


Jean-Damien DURAND (jdurand@pcfarm14.cern.ch) wrote:

:   Dear all,

:   Would someone in here please explain me why, when compiling the following
: so-simple program:

: int main () {
:   exit(0);
: }

:   with -pthread option, and intrumenting it with "third -env threads";

: [dxplus05] ~ % cc -pthread -o ./testit ./test.c
: [dxplus05] ~ % atom -tool third -env threads testit

:   I have the following in the 3log file:
: ------------------------------------------------------------------------

<Third report removed>

:   What misunderstanding or mistake am I doing ? Thanks a lot for any advice...

:   Cheers,                          Jean-Damien.

: FYI:
: [dxplus05] ~ % uname -a 
: OSF1 dxplus05 V4.0 564 alpha
: [dxplus05] ~ % what `which atom` | tail -1
:         $RCSfile: strerror.c,v $ $Revision: 4.2.8.3 $ (DEC) $Date: 1994/04/05 15:48:37 $


Jean-Damien,

-NOTE: This is IMHO and can not be shown to be true-

What you are seeing is memory being reserved (or used) by the pthreads 
library and by the libc library as well. Third reports memory that is
allocated, but not released. In the case of the libraries, they are
setting up gloabl variables of somesort. These are used for many different
things (speed of execution probably being one). This is one of
the difficulties with using third.

Hopes this helps,

Chris



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: third and pthread
  1999-02-08  5:00 third and pthread Jean-Damien DURAND
  1999-02-08  5:00 ` Chris Forrest
@ 1999-02-15  5:00 ` John P Williams
  1 sibling, 0 replies; 3+ messages in thread
From: John P Williams @ 1999-02-15  5:00 UTC (permalink / raw)
  To: Jean-Damien DURAND

Hi,

Chris Forrest's answer is correct - this version of Third Degree
is showing you all the memory that was allocated but not free'd,
including that allocated by libpthread and libc.

The large amounts of memory are the thread stacks for the main
thread and for libpthread's internal utility threads, and the 
numerous smaller ones are a mutex pool, I think.

In any case, none of the stack traces mention your code, so don't
worry about them. The "leaks" that you are seeing are just places
where we have found it more efficient to not free the memory.
Furthermore, the only leaks that you really want to worry about 
are those that occur multiple times within one of your loops,
because freeing those avoids waste, whereas freeing just before
exit does not.

We realize that these non-leaks in system libraries can cause undue
concern and unwanted clutter, so the new version of Third Degree 
does not report them by default. 

	John P Williams, Unix Development Environment Group, Compaq



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-02-15  5:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-02-08  5:00 third and pthread Jean-Damien DURAND
1999-02-08  5:00 ` Chris Forrest
1999-02-15  5:00 ` John P Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox