I am using dtrace to sample stack traces of a process like this:
# /usr/sbin/dtrace -p $MYPID -x ustackframes=100 stack.d -s -o stack.log
Where stack.d
looks like:
profile-99
/execname == "mybinary"/
{
@[execname, ustack()] = count();
}
I am adding -p
to dtrace
such that it has the symbols during stack writing even when the user process has already exited.
This works - but I observe 3 issues:
During tracing I regularly get error messages like:
dtrace: error on enabled probe ID 1 (ID 12345: profile:::profile-99):\
invalid address (0x0) in action #3
dtrace: error on enabled probe ID 1 (ID 12345: profile:::profile-99):\
invalid address (0xffffffff00000000) in action #3
dtrace: error on enabled probe ID 1 (ID 12345: profile:::profile-99):\
invalid address (0x7ffe8000) in action #3
[..]
(i.e. many of those)
What is the underlying issue there?
The process executes like it should (i.e. no crashes).
The other thing is that a lot of recorded stacks don't contain any symbols at all.
What are possible reasons for such symbol-less stacks?
Also - some stacks do not start with _start -> main
but still contain symbols (i.e. with function from the binary).
Are those incomplete stacks ones where dtrace somehow failed to get to the bottom?