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: ERROR: Build-id mismatch: "kernel" vs. "vmlinux" byte 0 (0x00 vs 0x00)


On Thu, Apr 08, 2010 at 02:30:49PM -0400, Frank Ch. Eigler wrote:
> Hi -
> 
> > The tcp_trace.stp works fine with systemtap 1.1 on  my system, but 1.2 
> > and the newer snapshots fail.
> 
> OK, that's good information.  Next step then is to run stap -k with
> both versions, and compare the /tmp/stapXXXX/* files, expecially
> stap-symbols.h.  They should be the same, specifically they should
> include the same buildid bytes / addresses.  That would leave only
> the buildid checking logic as different.  The new code in runtime/sym.c
> does this:
> 
>       set_fs(KERNEL_DS);
>       rc1 = get_user(theory,((unsigned char*) &m->build_id_bits[j]));
>       rc2 = get_user(practice,((unsigned char*) (void*) (notes_addr+j)));
>       set_fs(oldfs);
> 
> in order to fetch two bytes from kernel space (from not entirely
> reliable addresses).  The old code just memcmp'd the whole arrays
> (leading to crashes in the case of not entirely correct addresses).
> 
> 
> - FChE

Post 1.1 I've been seeing the following on i686 (x86_64 is ok):

ERROR: Build-id mismatch: "kernel" vs. "vmlinux-2.6.34-8-default.debug" byte 0 (0x00 vs 0x00) rc -14 -14
Pass 5: run failed.  Try again with another '--vp 00001' option.

as per irc discussion, following test diff fixed the problem on i686, I've not
tested on any other archs.

Tony


diff --git a/buildrun.cxx b/buildrun.cxx
index 4d4e235..e9cffcb 100644
--- a/buildrun.cxx
+++ b/buildrun.cxx
@@ -183,7 +183,7 @@ compile_pass (systemtap_session& s)
   output_autoconf(s, o, "autoconf-uprobe-get-pc.c", "STAPCONF_UPROBE_GET_PC", NULL);
   output_exportconf(s, o, "cpu_khz", "STAPCONF_CPU_KHZ");
 
-#if 0
+#if 1
   /* NB: For now, the performance hit of probe_kernel_read/write (vs. our
    * homegrown safe-access functions) is deemed undesireable, so we'll skip
    * this autoconf. */
diff --git a/runtime/sym.c b/runtime/sym.c
index 563d4f7..f0f9fb0 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -17,6 +17,10 @@
 #include "task_finder_vma.c"
 #include <asm/uaccess.h>
 
+#ifdef STAPCONF_PROBE_KERNEL
+#include <linux/uaccess.h>
+#endif
+
 /* Callback that needs to be registered (in
    session.unwindsyms_modules) for every user task path for which we
    might need symbols or unwind info. */
@@ -346,10 +350,15 @@ static int _stp_module_check(void)
                             int rc1, rc2;
                             unsigned char theory, practice;
 
+#ifdef STAPCONF_PROBE_KERNEL
+			    rc1=probe_kernel_read(&theory, (void*)&m->build_id_bits[j], 1);
+			    rc2=probe_kernel_read(&practice, (void*)(notes_addr+j), 1);
+#else
                             set_fs(KERNEL_DS);
                             rc1 = get_user(theory,((unsigned char*) &m->build_id_bits[j]));
                             rc2 = get_user(practice,((unsigned char*) (void*) (notes_addr+j)));
                             set_fs(oldfs);
+#endif
 
                             if (rc1 || rc2 || (theory != practice)) {
                                     const char *basename;


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