Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jul 2013 21:32:50 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Yuri <yuri@rawbw.com>
Cc:        FreeBSD Hackers <hackers@FreeBSD.org>
Subject:   Re: DTrace copyin with struct doesn't work?
Message-ID:  <51F01DD2.6060308@FreeBSD.org>
In-Reply-To: <51F01940.2020402@rawbw.com>
References:  <51F01940.2020402@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
on 24/07/2013 21:13 Yuri said the following:
> This simple .d script fails:
> 
> ---script begin---
> #!/usr/sbin/dtrace -s
> 
> struct my_args {
>    int ii;
> };
> 
> fbt::sys_select:entry
> {
>   printf("sys_select %i", ((struct my_args*)copyin(arg1, sizeof (struct
> my_args)))->ii);
> }
> ---script end---
> 
> dtrace: error on enabled probe ID 1 (ID 33598: fbt:kernel:sys_select:entry):
> invalid address (0xffffff82ff0799d8) in action #1 at DIF offset 40
> dtrace: error on enabled probe ID 1 (ID 33598: fbt:kernel:sys_select:entry):
> invalid address (0xffffff82fefb19d8) in action #1 at DIF offset 40
> 
> Function sys_select is defined in kern/sys_generic.c:
> int
> sys_select(struct thread *td, struct select_args *uap)

>From sys_select code it is clear that uap points to something that is already
copied in.  Unlike some fields within select_args.

> arg1 in DTrace script should correspond to uap argument of sys_select, and
> dereferencing should always produce an int.


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51F01DD2.6060308>