|
From: Tom H. <th...@cy...> - 2003-12-18 08:24:44
|
In message <1071709848.16950.17.camel@localhost.localdomain>
Jeremy Fitzhardinge <je...@go...> wrote:
> On Wed, 2003-12-17 at 03:41, Tom Hughes wrote:
>> With RH9 it was complaining about syscall 258 which is set_tid_address
>> which is called by ld.so early on, so valgrind never used to see it. A
>> patch to add support for this is attached.
>
> What does set_tid_address do again? It might be better to just silently
> fail it with ENOSYS since we're not doing anything useful with that
> stuff yet.
It gives the kernel a pointer to a pid_t which in which it should
store the current thread's tid whenever it feels like it. In this
case ld.so was actually passing NULL as the argument so it was in
fact turning off this functionality.
>> Although simple programs worked, a debug build of one of our main
>> programs failed to mmap many of the shared objects. I managed to work
>> round this by adjusting VALGRIND_MAPSIZE in stage2.c to a little
>> over 300Mb in size. Debug builds of our software are somewhat extreme
>> in their use of shared libraries - this program had about 150 or so
>> and they mostly had level 3 DWARF debugging on.
>
> It should only be trying to map one of those in at once - do you really
> have a 100MByte+ .so file?
No. It was looking at the symbol tables and was managing to map about
half the libraries then reporting mmap failed for the rest. As I increased
that number it gradually reported fewer and fewer failures.
>> I noticed that if you track FD leaks then both /usr/bin/valgrind and
>> the client executable are reported as leaks.
>
> That shouldn't be. What fds is it finding them at?
At 4 and 5, after stdin/out/err and my valgrind log fd which is 3:
==23501== FILE DESCRIPTORS: 6 open at exit.
==23501== Open file descriptor 5: /usr/cqcs/V72X/cqcs/vcq
==23501== <inherited from parent>
==23501==
==23501== Open file descriptor 4: /usr/bin/valgrind
==23501== <inherited from parent>
==23501==
==23501== Open file descriptor 3: /home/thh/vg.out
==23501== <inherited from parent>
==23501==
==23501== Open file descriptor 2: /dev/pts/1
==23501== <inherited from parent>
==23501==
==23501== Open file descriptor 1: /dev/pts/1
==23501== <inherited from parent>
==23501==
==23501== Open file descriptor 0: /dev/pts/1
==23501== <inherited from parent>
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|