0

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?

maxschlepzig
  • 35,645
  • 14
  • 145
  • 182
  • How up-to-date is your system? Searching for `dtrace ustack invalid address` results in hits with several mentions of stack tracing bugs in various earlier versions of dtrace. Documentation for `ustack()` is here: http://docs.oracle.com/cd/E19253-01/817-6223/chp-actsub-ustack/index.html `ustackframes` defaults to 20, so by default the result of `ustack()` will be limited to 20 stack frames. – Andrew Henle Jul 10 '15 at 01:10
  • @AndrewHenle, as I wrote I am using `-x ustackframes=100`. – maxschlepzig Jul 10 '15 at 06:18
  • @AndrewHenle, I am on Solaris 5.10 Generic_150400-18. – maxschlepzig Jul 10 '15 at 12:56

0 Answers0