Andreas Schwab <[email protected]> writes:

> Petr Machata <[email protected]> writes:
>
>> Andreas Schwab <[email protected]> writes:
>>
>>> I'm getting a lot of testsuite failures due to
>>>
>>> Couldn't determine base address of linux-vdso32.so.1
>>> Couldn't load ELF object linux-vdso32.so.1: No such file or directory
>>
>> What architecture is this on?
>
> Pick any that features a vdso.

Then perhaps it's a kernel that I haven't tested on.  I haven't seen it
so far.

>> Apparently l_name of VDSO in r_debug
>> linkmap isn't always simply an empty string.  Perhaps we should ignore
>> entries that don't have full pathname in l_name.  Does the following
>> fix it for you?
>
> I think a valid l_name can be relative, too.

You are right:

$ export LD_LIBRARY_PATH=.
$ gdb ./libdl-simple
(gdb) p *_r_debug->r_map->l_next->l_next->l_next->l_next->l_next->l_next
$8 = {l_addr = 140737341272064, l_name = 0x601010 "./liblibdl-simple.so", l_ld 
= 0x7ffff75bb620, l_next = 0x0, l_prev = 0x7ffff7ffd998}

Hmm, so how about this?

diff --git a/sysdeps/linux-gnu/proc.c b/sysdeps/linux-gnu/proc.c
index 9c864f3..130d947 100644
--- a/sysdeps/linux-gnu/proc.c
+++ b/sysdeps/linux-gnu/proc.c
@@ -504,12 +504,13 @@ crawl_linkmap(struct Process *proc, struct lt_r_debug_64 
*dbg)
                umovebytes(proc, (arch_addr_t)(uintptr_t)rlm.l_name,
                           lib_name, sizeof(lib_name));
 
-               if (*lib_name == '\0') {
-                       /* VDSO.  No associated file, XXX but we might
-                        * load it from the address space of the
-                        * process.  */
+               /* Valid library name is either an absolute or a
+                * relative file name.  An empty string or completely
+                * unqualified name is likely a VDSO.  There's no file
+                * associated with VDSO.  XXX though we could read it
+                * from process memory.  */
+               if (*lib_name != '/' && *lib_name != '.')
                        continue;
-               }
 
                /* Do we have that library already?  */
                if (proc_each_library(proc, NULL, library_with_key_cb, &key))

Alternatively we might a per-arch black-list, but I'd rather solve this
as simply as possible.

Thanks,
PM

_______________________________________________
Ltrace-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/ltrace-devel

Reply via email to