This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] [patchv2] Fix vDSO l_name for GDB's: Can't read pathname for load map: Input/output error.


On Thu, 07 Nov 2013 23:07:19 +0100, Carlos O'Donell wrote:
> >> Does the entire glibc testsuite pass after this change?
> >> * It might change the output of LD_DEBUG=all?

It does not.


> >> * It might change the output of sotruss-lib used for testing?

Unaware how to test it but I really doubt the patch can change anything.


> Did you see any regressions?

No.  I have followed
	https://sourceware.org/glibc/wiki/Testing/Testsuite

and after reconfiguring --prefix to /usr I got 0 from: make -j1 check; echo $?


> >> Do other tools run OK after this change?
> >> * Valgrind has no problems?

'valgrind /bin/true' is OK.

> >> * gdb itself has no problems? (I assume it doesn't)

Exactly.

> >> * ldd shows now difference? (Related to LD_DEBUG=all above, but in trace mode)

No.

> I suggest the following more verbose comment:

Done.

> OK with those changes, and confirmation that no regressions were seen in the
> glibc testsuite.

Checked in.


On Fri, 08 Nov 2013 03:39:15 +0100, Carlos O'Donell wrote:
> Please also add `[BZ #387]' to your ChangeLog, and close out bug 387 as
> fixed.

Done.


I had to put there a cast, as the former patch printed:
dl-object.c:93:15: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
   new->l_name = *realname ? realname : newname->name + libname_len - 1;


Thanks,
Jan
commit 9182aa67994f4e8db378a949812176453e06cb34
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Mon Nov 11 18:03:58 2013 +0100

    Fix vDSO l_name for GDB's: Can't read pathname for load map: Input/output error.

diff --git a/ChangeLog b/ChangeLog
index d330b58..2d9785b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-11-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	[BZ #387]
+	* elf/dl-object.c (_dl_new_object): Initialize L_NAME from NEWNAME if
+	it is empty.
+
 2013-11-11  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
         * benchtests/Makefile: Add bench-strtod.
diff --git a/elf/dl-object.c b/elf/dl-object.c
index 0f594d2..26d4f44 100644
--- a/elf/dl-object.c
+++ b/elf/dl-object.c
@@ -88,7 +88,13 @@ _dl_new_object (char *realname, const char *libname, int type,
   /* newname->next = NULL;	We use calloc therefore not necessary.  */
   newname->dont_free = 1;
 
-  new->l_name = realname;
+  /* When we create the executable link map, or a VDSO link map, we start
+     with "" for the l_name. In these cases "" points to ld.so rodata
+     and won't get dumped during core file generation. Therefore to assist
+     gdb and to create more self-contained core files we adjust l_name to
+     point at the newly allocated copy (which will get dumped) instead of
+     the ld.so rodata copy.  */
+  new->l_name = *realname ? realname : (char *) newname->name + libname_len - 1;
   new->l_type = type;
   /* If we set the bit now since we know it is never used we avoid
      dirtying the cache line later.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]