From owner-freebsd-current@FreeBSD.ORG Fri May 22 07:32:01 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D3931065678 for ; Fri, 22 May 2009 07:32:01 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id EEB898FC1E for ; Fri, 22 May 2009 07:31:56 +0000 (UTC) (envelope-from serenity@exscape.org) Received: from c83-253-252-234.bredband.comhem.se ([83.253.252.234]:45243 helo=mx.exscape.org) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1M7PEM-0000DR-50; Fri, 22 May 2009 09:31:52 +0200 Received: from [192.168.1.5] (macbookpro [192.168.1.5]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mx.exscape.org (Postfix) with ESMTPSA id 655853357A; Fri, 22 May 2009 09:31:46 +0200 (CEST) Message-Id: <44F486FA-E798-448D-BE31-F7A51EF1F612@exscape.org> From: Thomas Backman To: Mel Flynn In-Reply-To: <200905212129.47892.mel.flynn+fbsd.current@mailing.thruhere.net> Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v935.3) Date: Fri, 22 May 2009 09:31:44 +0200 References: <949B5884-5303-4EFF-AC7D-293640FFA012@exscape.org> <0C235698-3ED2-4AE9-A7D1-5DC56D8324A4@exscape.org> <200905212129.47892.mel.flynn+fbsd.current@mailing.thruhere.net> X-Mailer: Apple Mail (2.935.3) X-Originating-IP: 83.253.252.234 X-Scan-Result: No virus found in message 1M7PEM-0000DR-50. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1M7PEM-0000DR-50 3264c8b5388051d3a9e12196620d36e2 Cc: freebsd-current@freebsd.org Subject: Re: DTrace panic while probing syscall::open (and possibly many others) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2009 07:32:01 -0000 On May 21, 2009, at 09:29 PM, Mel Flynn wrote: > On Thursday 21 May 2009 18:53:56 Thomas Backman wrote: >> On May 13, 2009, at 03:19 PM, Thomas Backman wrote: > > > >>> #11 0xffffffff8123c200 in dtrace_copycheck >>> (uaddr=3D18446744071581326184, kaddr=3DVariable "kaddr" is not =20 >>> available. >>> ) at dtrace_isa.c:527 > >> In /sys/cddl/dev/dtrace/amd64/dtrace_isa.c: >> static int >> dtrace_copycheck(uintptr_t uaddr, uintptr_t kaddr, size_t size) >> { >> printf("in dtrace_copycheck(), pre-ASSERT:\n"); >> printf("kaddr =3D %u, kernelbase =3D %u, size =3D %d, kaddr+size = =3D %u\n >> \n", >> (unsigned int)kaddr, (unsigned int)kernelbase, (unsigned >> int)size, (unsigned int)(kaddr+size)); >> ASSERT(kaddr >=3D kernelbase && kaddr + size >=3D kaddr); >> >> if (uaddr + size >=3D kernelbase || uaddr + size < uaddr) { >> ... >> >> So, I added two printf statements. What happens? IT BECOMES STABLE. > > I'm no kernel hacker, but.. if you apply the patch below, does it =20 > still panic? > Make sure to get rid of the printf() you added. > > The theory behind this patch is that kernbase isn't initialized at =20 > the time of > that assert, yet code from printf initializes it. > > --- dtrace_isa.c.orig 2009-05-21 21:18:54.000000000 +0200 > +++ dtrace_isa.c 2009-05-21 21:23:40.000000000 +0200 > @@ -40,7 +40,8 @@ > #include > #include > > -extern uintptr_t kernbase; > +//extern uintptr_t kernbase; > +static uintptr_t kernbase =3D KERNBASE; > uintptr_t kernelbase =3D (uintptr_t) &kernbase; > > #define INKERNEL(va) (((vm_offset_t)(va)) >=3D USRSTACK && \ Hmmmmm. Nope, still panics with your patch, unfortunately. So I =20 reverted to my hack, but that doesn't work anymore, either! I did a =20 full buildworld/buildkernel yesterday, WITHOUT csup'ing before, so the =20= source should have stayed the same. Now I get this: # dtrace -n 'syscall::open:entry { trace(copyinstr(arg0)); }' dtrace: description 'syscall::open:entry ' matched 1 probe CPU ID FUNCTION:NAME 0 38977 open:entry 0 1 2 3 4 5 6 7 8 9 a b c d e f =20 0123456789abcdef 0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =20 00 ................ 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =20 00 ................ [...snip...] dtrace: error on enabled probe ID 1 (ID 38977: syscall::open:entry): =20 invalid address (0xffffff803e9afae0) in action #1 at DIF offset 28 dtrace: error on enabled probe ID 1 (ID 38977: syscall::open:entry): =20 invalid address (0xffffff803e9afae0) in action #1 at DIF offset 28 dtrace: error on enabled probe ID 1 (ID 38977: syscall::open:entry): =20 invalid address (0xffffff803e9afae0) in action #1 at DIF offset 28 Same error using opensnoop and/or printing and copying in =20 in :::return, so something happened with the kernel (modules): dtrace: error on enabled probe ID 3 (ID 38978: syscall::open:return): =20= invalid address (0xffffff803e9faae0) in action #10 at DIF offset 28 710400 1970 Jan 1 01:00:00 0 1370 5509120 =20 2 vnstat\0 718047 1970 Jan 1 01:00:00 0 1370 5509120 =20 0 vnstat\0 dtrace: error on enabled probe ID 3 (ID 38978: syscall::open:return): =20= invalid address (0xffffff803e9afae0) in action #10 at DIF offset 28 dtrace: error on enabled probe ID 3 (ID 38978: syscall::open:return): =20= invalid address (0xffffff803e9afae0) in action #10 at DIF offset 28 742667 1970 Jan 1 01:00:00 0 1370 46927872 2 =20 =EF=BF=BD;=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDX=C4=BB = vnstat\0 750430 1970 Jan 1 01:00:00 0 1370 46927872 0 =20 =EF=BF=BD;=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BDX=C4=BB = vnstat\0 (If this appears broken, beyond a few characters, that's because it IS =20= on my screen as well.) The address (0xffffff803e9afae0) changes without restarting dtrace, =20 but it appears fairly constant. ----------- Now, after reinstalling the modules and rebooting (rather than =20 kldunload dtraceall && make install && kldload dtraceall), it works =20 with my ugly hack again. Weird. Since it's all modules, why would it =20 not work to unload, recompile and reload? Regards, Thomas=