Valgrind memory cleanup,problems

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Valgrind memory cleanup,problems

Eric Lauzon
==20806==
==20806== Invalid read of size 4
==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long double,...)(short) (vg_intercept.c:55)
==20806==    by 0x1B9B3585: exit (in /lib/libc-2.3.4.so)
==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
==20806==    by 0x1BAB6C84: __pthread_sighandler (in /lib/libpthread-0.10.so)
==20806==    by 0x1B9B0DB7: (within /lib/libc-2.3.4.so)
==20806==  Address 0xC is not stack'd, malloc'd or (recently) free'd
==20806==
==20806== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==20806==  Access not within mapped region at address 0xC
==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long double,...)(short) (vg_intercept.c:55)
==20806==    by 0x1B9B3585: exit (in /lib/libc-2.3.4.so)
==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
==20806==    by 0x1BAB6C84: __pthread_sighandler (in /lib/libpthread-0.10.so)
==20806==    by 0x1B9B0DB7: (within /lib/libc-2.3.4.so)
==20806==
==20806== ERROR SUMMARY: 497 errors from 3 contexts (suppressed: 41 from 1)
==20806== malloc/free: in use at exit: 17798 bytes in 182 blocks.
==20806== malloc/free: 49680 allocs, 49498 frees, 28959643 bytes allocated.
==20806== For counts of detected errors, rerun with: -v
==20806== searching for pointers to 182 not-freed blocks.
==20806== checked 1141308 bytes.
==20806==

All those bugs seem to come from valgrind ..unfortunatly

Eric Lauzon
[Recherche & Développement]
Above Sécurité / Above Security
Tél  : (450) 430-8166
Fax : (450) 430-1858


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|

Re: Valgrind memory cleanup,problems

njn (Bugzilla)-2
On Fri, 17 Jun 2005, Eric Lauzon wrote:

> ==20806== Invalid read of size 4
> ==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long double,...)(short) (vg_intercept.c:55)
> ==20806==    by 0x1B9B3585: exit (in /lib/libc-2.3.4.so)
> ==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
> ==20806==    by 0x1BAB6C84: __pthread_sighandler (in /lib/libpthread-0.10.so)
> ==20806==    by 0x1B9B0DB7: (within /lib/libc-2.3.4.so)
> ==20806==  Address 0xC is not stack'd, malloc'd or (recently) free'd
> ==20806==
> ==20806== Process terminating with default action of signal 11 (SIGSEGV): dumping core
> ==20806==  Access not within mapped region at address 0xC
> ==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long double,...)(short) (vg_intercept.c:55)
> ==20806==    by 0x1B9B3585: exit (in /lib/libc-2.3.4.so)
> ==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
> ==20806==    by 0x1BAB6C84: __pthread_sighandler (in /lib/libpthread-0.10.so)
> ==20806==    by 0x1B9B0DB7: (within /lib/libc-2.3.4.so)
> ==20806==
> ==20806== ERROR SUMMARY: 497 errors from 3 contexts (suppressed: 41 from 1)
> ==20806== malloc/free: in use at exit: 17798 bytes in 182 blocks.
> ==20806== malloc/free: 49680 allocs, 49498 frees, 28959643 bytes allocated.
> ==20806== For counts of detected errors, rerun with: -v
> ==20806== searching for pointers to 182 not-freed blocks.
> ==20806== checked 1141308 bytes.
> ==20806==
>
> All those bugs seem to come from valgrind ..unfortunatly

It seems that way, but it's not the case.  Valgrind is calling
__libc_freeres, a glibc function that frees up memory at the end of a
program.  So the bug is in glibc, or possibly the program being checked.
If you run with --run-libc-freeres=no the warnings should go away,
although that might make leak checking less accurate/useful.

[Nb: the "_vgw(float, long double,...)..." is a minor bug in the stack
trace formation -- it should say "_vgw_freeres).  It's not present in 3.0,
but I don't know what the change that fixed it was.]

N


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|

Re: Valgrind memory cleanup,problems

Julian Seward-2
In reply to this post by Eric Lauzon

What version of valgrind is this?  What version of glibc?

J

On Friday 17 June 2005 20:51, Eric Lauzon wrote:

> ==20806==
> ==20806== Invalid read of size 4
> ==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long
> double,...)(short) (vg_intercept.c:55) ==20806==    by 0x1B9B3585: exit (in
> /lib/libc-2.3.4.so)
> ==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
> ==20806==    by 0x1BAB6C84: __pthread_sighandler (in
> /lib/libpthread-0.10.so) ==20806==    by 0x1B9B0DB7: (within
> /lib/libc-2.3.4.so)
> ==20806==  Address 0xC is not stack'd, malloc'd or (recently) free'd
> ==20806==
> ==20806== Process terminating with default action of signal 11 (SIGSEGV):
> dumping core ==20806==  Access not within mapped region at address 0xC
> ==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
> ==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long
> double,...)(short) (vg_intercept.c:55) ==20806==    by 0x1B9B3585: exit (in
> /lib/libc-2.3.4.so)
> ==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
> ==20806==    by 0x1BAB6C84: __pthread_sighandler (in
> /lib/libpthread-0.10.so) ==20806==    by 0x1B9B0DB7: (within
> /lib/libc-2.3.4.so)
> ==20806==
> ==20806== ERROR SUMMARY: 497 errors from 3 contexts (suppressed: 41 from 1)
> ==20806== malloc/free: in use at exit: 17798 bytes in 182 blocks.
> ==20806== malloc/free: 49680 allocs, 49498 frees, 28959643 bytes allocated.
> ==20806== For counts of detected errors, rerun with: -v
> ==20806== searching for pointers to 182 not-freed blocks.
> ==20806== checked 1141308 bytes.
> ==20806==
>
> All those bugs seem to come from valgrind ..unfortunatly
>
> Eric Lauzon
> [Recherche & Développement]
> Above Sécurité / Above Security
> Tél  : (450) 430-8166
> Fax : (450) 430-1858
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=Click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=Click
> _______________________________________________
> Valgrind-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/valgrind-users


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|

RE: Valgrind memory cleanup,problems

Eric Lauzon
In reply to this post by Eric Lauzon
Yhea sorry

someone replied

> -----Original Message-----
> From: Nicholas Nethercote [mailto:[hidden email]]
> Sent: 17 juin 2005 16:36
> To: Eric Lauzon
> Cc: [hidden email]
> Subject: [SPAM] Re: [Valgrind-users] Valgrind memory cleanup,problems
> Importance: Low
>
> It seems that way, but it's not the case.  Valgrind is
> calling __libc_freeres, a glibc function that frees up memory
> at the end of a program.  So the bug is in glibc, or possibly
> the program being checked.
> If you run with --run-libc-freeres=no the warnings should go
> away, although that might make leak checking less accurate/useful.
>
> [Nb: the "_vgw(float, long double,...)..." is a minor bug in
> the stack trace formation -- it should say "_vgw_freeres).  
> It's not present in 3.0, but I don't know what the change
> that fixed it was.]
>
> N

so --run-libc-freeres=no fix the core-dump problem. But i still have
wierd libc leakage [reported from valgrind]

glibc version is :
GNU C Library stable release version 2.3.4, by Roland McGrath et al.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 3.3.4.
Compiled on a Linux 2.4.29 system on 2005-01-28.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        linuxthreads-0.10 by Xavier Leroy
        BIND-8.2.3-T5B
        libthread_db work sponsored by Alpha Processor Inc
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk

valgrind is : 2.4.0 stable.
current kernel is : 2.6.11-7


-elz


 

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf
> Of Julian Seward
> Sent: 17 juin 2005 16:46
> To: [hidden email]
> Subject: Re: [Valgrind-users] Valgrind memory cleanup,problems
>
>
> What version of valgrind is this?  What version of glibc?
>
> J
>
> On Friday 17 June 2005 20:51, Eric Lauzon wrote:
> > ==20806==
> > ==20806== Invalid read of size 4
> > ==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long
> > double,...)(short) (vg_intercept.c:55) ==20806==    by
> 0x1B9B3585: exit (in
> > /lib/libc-2.3.4.so)
> > ==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
> > ==20806==    by 0x1BAB6C84: __pthread_sighandler (in
> > /lib/libpthread-0.10.so) ==20806==    by 0x1B9B0DB7: (within
> > /lib/libc-2.3.4.so)
> > ==20806==  Address 0xC is not stack'd, malloc'd or
> (recently) free'd
> > ==20806== ==20806== Process terminating with default action
> of signal
> > 11 (SIGSEGV):
> > dumping core ==20806==  Access not within mapped region at
> address 0xC
> > ==20806==    at 0x1BA7D0EC: free_derivation (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA403B2: tdestroy_recurse (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA403D5: tdestroy_recurse (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA40256: tdestroy (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA7D074: free_mem (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1BA7D7D4: __libc_freeres (in /lib/libc-2.3.4.so)
> > ==20806==    by 0x1B8FC817: _vgw(float, long double,...)(...)(long
> > double,...)(short) (vg_intercept.c:55) ==20806==    by
> 0x1B9B3585: exit (in
> > /lib/libc-2.3.4.so)
> > ==20806==    by 0x804A78B: CleanExit (barnyard.c:566)
> > ==20806==    by 0x1BAB6C84: __pthread_sighandler (in
> > /lib/libpthread-0.10.so) ==20806==    by 0x1B9B0DB7: (within
> > /lib/libc-2.3.4.so)
> > ==20806==
> > ==20806== ERROR SUMMARY: 497 errors from 3 contexts (suppressed: 41
> > from 1) ==20806== malloc/free: in use at exit: 17798 bytes
> in 182 blocks.
> > ==20806== malloc/free: 49680 allocs, 49498 frees, 28959643
> bytes allocated.
> > ==20806== For counts of detected errors, rerun with: -v ==20806==
> > searching for pointers to 182 not-freed blocks.
> > ==20806== checked 1141308 bytes.
> > ==20806==
> >
> > All those bugs seem to come from valgrind ..unfortunatly
> >
> > Eric Lauzon
> > [Recherche & Développement]
> > Above Sécurité / Above Security
> > Tél  : (450) 430-8166
> > Fax : (450) 430-1858
> >
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by: Discover Easy Linux Migration
> Strategies
> > from IBM. Find simple to follow Roadmaps, straightforward articles,
> > informative Webcasts and more! Get everything you need to get up to
> > speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=Click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=Click
> > _______________________________________________
> > Valgrind-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration
> Strategies from IBM. Find simple to follow Roadmaps,
> straightforward articles, informative Webcasts and more! Get
> everything you need to get up to speed, fast.
> <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick">http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick
> _______________________________________________
> Valgrind-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. <a href="http://ads.osdn.com/?ad_idt77&alloc_id492&op=click">http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users