This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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]

Re: How to debug what I am doing wrong?


> Hmm.  I just tried to do a strace -eopen on eu-strip and on stap, and
> it looks like it's not trying to search for the file in /usr/lib/debug
> at all.  I'm using the version of elfutils that shipped with Ubuntu
> Hardy (since I was assured it wasn't necessary to build your own
> version of elfutils).  I seem to be using version 0.131-3 of elfutils
> from Ubuntu; could that be the problem?

It's a libdwfl bug.  When there is a build ID, it always looks for the file
by build ID first.  The bug is that it's then not falling back to the path
search based on the file name as it should.  I've put the fix below into
elfutils upstream.


Thanks,
Roland


libdwfl/
2008-07-17  Roland McGrath  <roland@redhat.com>

	* dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
	zero if the failure was only ENOENT.

--- libdwfl/dwfl_build_id_find_elf.c	5780a35eb84a17f2cb1e8fcba2d7c95e51673e63
+++ libdwfl/dwfl_build_id_find_elf.c	6afdebe48e2da91dd355b198c03b383c6bd3c088
@@ -119,6 +119,13 @@ __libdwfl_open_by_build_id (Dwfl_Module 
       free (name);
     }
 
+  /* If we simply found nothing, clear errno.  If we had some other error
+     with the file, report that.  Possibly this should treat other errors
+     like ENOENT too.  But ignoring all errors could mask some that should
+     be reported.  */
+  if (fd < 0 && errno == ENOENT)
+    errno = 0;
+
   return fd;
 }
 


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