From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25055 invoked by alias); 10 Jun 2010 23:28:42 -0000 Received: (qmail 25044 invoked by uid 22791); 10 Jun 2010 23:28:42 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 10 Jun 2010 23:28:37 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 88C4086A2E; Fri, 11 Jun 2010 01:28:34 +0200 (CEST) Date: Fri, 11 Jun 2010 15:53:00 -0000 From: Tony Jones To: "Frank Ch. Eigler" Cc: Karl Hiramoto , systemtap@sourceware.org Subject: Re: ERROR: Build-id mismatch: "kernel" vs. "vmlinux" byte 0 (0x00 vs 0x00) Message-ID: <20100610232420.GA32597@suse.de> References: <4BBCB7AE.8050603@hiramoto.org> <4BBD7BC0.5060009@hiramoto.org> <20100408145533.GA28054@redhat.com> <4BBE073E.7020602@hiramoto.org> <20100408170639.GB28054@redhat.com> <4BBE1F35.3010906@hiramoto.org> <20100408183049.GC28054@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100408183049.GC28054@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00533.txt.bz2 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 +#ifdef STAPCONF_PROBE_KERNEL +#include +#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;