|
From: Mathieu L. <mat...@gm...> - 2010-02-07 19:24:50
|
hi, I would like to make sure that one of my cleanup functions which should be run when the program is running under valgrind is run _after_ __libc_freeres by memcheck. From reading a bit the code, I see that __libc_freeres is called by valgrind within the process context when the process calls exit_group and valgrind appears to stop once freeres completes. Am I right ? If so, I suspect that what I need to do can't be done. Such is life. As a side-note, I think that it's wrong to call __libc_freeres that way. It should be called by an atexit handler _before_ the atexit handler of the dynamic loader runs. i.e., valgrind should find a way to call atexit (__libc_freeres) upon entry in main (the loader registers its own atexit handler before so it will run logically after). The rationale for this is that the loader should be free to do whatever it thinks is right within its atexit handler which includes doing things which will make it unable to resolve symbols after its handler runs. Mathieu -- Mathieu Lacage <mat...@gm...> |