illumos-docbooks icon indicating copy to clipboard operation
illumos-docbooks copied to clipboard

DTrace Guide: invalid user access on OSX

Open JustinChristensen opened this issue 4 years ago • 0 comments

On OSX, processes that request PT_DENY_ATTACH with the ptrace system call will cause dtrace to log a message about invalid user access when attempting to access that process' memory.

[[email protected]] (master) $ sudo dtruss -n ssh-agent
dtrace: error on enabled probe ID 2708 (ID 224: syscall::accept:return): invalid user access in action #5 at DIF offset 0

The OSX dtrace manual page makes no reference to this, and this behavior and message may lead dtrace beginners, like me, to think that they're incorrectly accessing memory they haven't copied into the dtrace address space yet.

There's also no way that I see to force dtrace on OSX to ignore PT_DENY_ATTACH processes, but that's a separate issue from the documentation itself.

@rmustacc thought that this behavior might be worth documenting in the dtrace guide.

JustinChristensen avatar Sep 21 '20 23:09 JustinChristensen