Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 May 2009 21:29:47 +0200
From:      Mel Flynn <mel.flynn+fbsd.current@mailing.thruhere.net>
To:        freebsd-current@freebsd.org
Cc:        Thomas Backman <serenity@exscape.org>
Subject:   Re: DTrace panic while probing syscall::open (and possibly many others)
Message-ID:  <200905212129.47892.mel.flynn%2Bfbsd.current@mailing.thruhere.net>
In-Reply-To: <0C235698-3ED2-4AE9-A7D1-5DC56D8324A4@exscape.org>
References:  <949B5884-5303-4EFF-AC7D-293640FFA012@exscape.org> <0C235698-3ED2-4AE9-A7D1-5DC56D8324A4@exscape.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 21 May 2009 18:53:56 Thomas Backman wrote:
> On May 13, 2009, at 03:19 PM, Thomas Backman wrote:

<snip electrons>

> > #11 0xffffffff8123c200 in dtrace_copycheck
> > (uaddr=18446744071581326184, kaddr=Variable "kaddr" is not 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 = %u, kernelbase = %u, size = %d, kaddr+size = %u\n
> \n",
>         (unsigned int)kaddr, (unsigned int)kernelbase, (unsigned
> int)size, (unsigned int)(kaddr+size));
>      ASSERT(kaddr >= kernelbase && kaddr + size >= kaddr);
>
>      if (uaddr + size >= 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 still panic? 
Make sure to get rid of the printf() you added.

The theory behind this patch is that kernbase isn't initialized at 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 <vm/vm_param.h>
 #include <vm/pmap.h>

-extern uintptr_t kernbase;
+//extern uintptr_t kernbase;
+static uintptr_t kernbase = KERNBASE;
 uintptr_t kernelbase = (uintptr_t) &kernbase;

 #define INKERNEL(va) (((vm_offset_t)(va)) >= USRSTACK && \
 
-- 
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905212129.47892.mel.flynn%2Bfbsd.current>