[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Calling ustack(); from DTrace script crashes the user process
From:       Yuri <yuri () rawbw ! com>
Date:       2013-01-25 20:22:50
Message-ID: 5102E99A.2070402 () rawbw ! com
[Download RAW message or body]

I am calling ustack(); from the 'ioctl' handler called by Xorg process. 
My intention is to see the user stack.
On the first few instances I got this error:
dtrace: ERROR: open  failed: No such file or directory
-- no file name is mentioned, double-space is printed in the message

After a while the same exact script began to crash Xorg process.

Before crashes occurred I was able to get the truss log, showing that 
multiple dev-files failed to open:
  5191: open("/dev/dtrace/dtrace",O_RDONLY,00)    = 3 (0x3)
  5191: open("/dev/dtrace/io",O_RDONLY,00)        ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/dtmalloc",O_RDONLY,00)  = 4 (0x4)
  5191: open("/dev/dtrace/nfscl",O_RDONLY,00)     ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/nfsclient",O_RDONLY,00) ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/fbt",O_RDONLY,00)       = 5 (0x5)
  5191: open("/dev/dtrace/lockstat",O_RDONLY,00)  = 6 (0x6)
  5191: open("/dev/dtrace/priv",O_RDONLY,00)      ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/sched",O_RDONLY,00)     ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/mac",O_RDONLY,00)       ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/mac_framework",O_RDONLY,00) ERR#2 'No such 
file or directory'
  5191: open("/dev/dtrace/cbb",O_RDONLY,00)       ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/sctp",O_RDONLY,00)      ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/callout_execute",O_RDONLY,00) ERR#2 'No such 
file or directory'
  5191: open("/dev/dtrace/vfs",O_RDONLY,00)       ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/proc",O_RDONLY,00)      ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/syscall",O_RDONLY,00)   ERR#2 'No such file or 
directory'
  5191: open("/dev/dtrace/syscall",O_RDONLY,00)   ERR#2 'No such file or 
directory'

I satisfied all conditions mentioned in https://wiki.freebsd.org/DTrace 
on how to run DTrace on 9.0 (I am on 9.1-STABLE). kernel modules are 
loaded, see below.

So:
* Why/How ustack kills the user process? (amazing this is even possible)
* Why files like /dev/dtrace/io don't exist?

Maybe some extra-options are required for ustack() to work? If this is 
the case this should be mentioned in wiki.

Yuri


# kldstat
Id Refs Address            Size     Name
  3   16 0xffffffff81861000 84c0     opensolaris.ko
  4    4 0xffffffff8186a000 53a00    linux.ko
10    1 0xffffffff82612000 9e50     linprocfs.ko
12    1 0xffffffff82627000 25b      linux_adobe.ko
13    2 0xffffffff82628000 baa      dtraceall.ko
14    1 0xffffffff82629000 4eca     profile.ko
15    3 0xffffffff8262e000 4005     cyclic.ko
16   12 0xffffffff82633000 23baaf   dtrace.ko
17    1 0xffffffff8286f000 fae8     systrace_freebsd32.ko
18    1 0xffffffff8287f000 109a5    systrace.ko
19    1 0xffffffff82890000 45a8     sdt.ko
20    1 0xffffffff82895000 4938     lockstat.ko
21    1 0xffffffff8289a000 be09     fasttrap.ko
22    1 0xffffffff828a6000 65e2     fbt.ko
23    1 0xffffffff828ad000 4ee4     dtnfsclient.ko
24    1 0xffffffff828b2000 1dbeb    nfsclient.ko
25    1 0xffffffff828d0000 47da     nfs_common.ko
26    1 0xffffffff828d5000 55ec     dtnfscl.ko
27    1 0xffffffff828db000 4597     dtmalloc.ko
28    1 0xffffffff828e0000 44fd     dtio.ko
29    1 0xffffffff828e5000 2466     dtrace_test.ko
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic