|
From: Beorn J. <beo...@ya...> - 2005-05-17 05:36:30
|
I have discovered the solution to my own problem. Internally, valgrind uses 'readlink( )' on "/proc/self/fd/nn" when 'mmap( )'-ing fd #nn (which is done for 'dlopen( )'). In my case, 'readlink()' was failing. Internally, I could use the 'allocated_fds' list (with '--track-fds=yes') to get the right behavior. Then I realized my problem: my process uses 'seteuid( )' (before 'dlopen( )'-ing it's shared objects), which changes the effective uid of the process but not of '/proc/self/'. So, 'readlink( )' can't read "/proc/self/fd/nn", and the 'mmap( )' doesn't have the associated filename with which to generate address->name mapping. I hope someone else can benefit from my experience. - Beorn Johnson Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html |
|
From: Jeremy F. <je...@go...> - 2005-05-17 19:34:15
|
Beorn Johnson wrote:
>Then I realized my problem: my process uses 'seteuid( )'
>(before 'dlopen( )'-ing it's shared objects), which changes
>the effective uid of the process but not of '/proc/self/'.
>So, 'readlink( )' can't read "/proc/self/fd/nn",
>and the 'mmap( )' doesn't have the associated filename
>with which to generate address->name mapping.
>
Hm, interesting. I wonder if that could be considered a kernel bug...
J
|
|
From: Andi K. <ak...@mu...> - 2005-05-17 20:36:33
|
Jeremy Fitzhardinge <je...@go...> writes: > Beorn Johnson wrote: > >>Then I realized my problem: my process uses 'seteuid( )' >>(before 'dlopen( )'-ing it's shared objects), which changes >>the effective uid of the process but not of '/proc/self/'. >>So, 'readlink( )' can't read "/proc/self/fd/nn", >>and the 'mmap( )' doesn't have the associated filename >>with which to generate address->name mapping. >> > Hm, interesting. I wonder if that could be considered a kernel bug... It's a redhat specific bug, side effect of execshield which considers your /proc/self/maps as a secret and changes the permissions. Just unapply the execshield patch or use a mainline kernel. -Andi |
|
From: Jeremy F. <je...@go...> - 2005-05-18 06:31:10
|
Andi Kleen wrote:
>>Hm, interesting. I wonder if that could be considered a kernel bug...
>>
>>
>
>It's a redhat specific bug, side effect of execshield which
>considers your /proc/self/maps as a secret and changes the permissions.
>
>Just unapply the execshield patch or use a mainline kernel.
>
This is /proc/self/fd/* though.
J
|