2011/4/22, Mike Gerdts <[email protected]>:
> On Fri, Apr 22, 2011 at 11:54 AM, Attila Rajmund Nohl
> <[email protected]> wrote:
>> compilation error, then
>>
>> ctlptr = (struct strbuf*)arg1;
>> printf("maxlen: %5d", ctlptr->maxlen);
>>
>> and got:
>>
>> dtrace: error on enabled probe ID 1 (ID 6236: syscall::putmsg:entry):
>> invalid address (0xffbfeeac) in action #6 at DIF offset 4
>
> This gives you a pointer into userspace. The dtrace probes operate in
> kernel space. Something like this should do it:
>
> ctlptr = (struct strbuf*)copyin(arg1, sizeof(struct strbuf));
Thanks, that helped. However, this strbuf structure has a pointer and
I'd like to know what it points at. My guess this is also a user space
pointer, so I should use something like this:
printf("buf: %s\n", copyinstr((uintptr_t)ctlptr->buf, ctlptr->len));
but I get again an error like this:
dtrace: error on enabled probe ID 2 (ID 6237: syscall::putmsg:return):
invalid address (0xffbfeeb800000000) in action #10 at DIF offset 64
Of course, I get similar error even without the copyinstr:
printf("buf: %s\n", stringof(ctlptr->buf));
dtrace: error on enabled probe ID 2 (ID 6237: syscall::putmsg:return):
invalid address (0xffbfeeb800000000) in action #10
I've moved the printf call to the system call return section, but no
lock. The value of ctlptr->buf is 0x0000000b (which is slightly
suspicious, because it's quite low number). Should the printf above
work or does the pointer has wrong value?
_______________________________________________
dtrace-discuss mailing list
[email protected]