Interesting, I''m on S10U1, and I''ve got a ksh script doing
this:
mypid=`dtrace -wqn "$dtrace" -c ./my_script`
And dtrace hangs. The ksh process doesn''t seem to properly reap the
dtrace
process for some reason. But if I use:
dtrace -wqn "$dtrace" -c ./my_script > /tmp/mypid$$
mypid=`cat /tmp/mypid$$`
Then it seems to work.
% truss -f -texec,fork ./go
14495: execve("/usr/bin/ksh", 0xFFBFEA84, 0xFFBFEA90) argc = 2
14495: fork1() = 14496
14496: fork1() (returning as child ...) = 14495
14496: execve("/usr/sbin/dtrace", 0x00058F78, 0x000590A8) argc = 5
14496: execve("/usr/sbin/sparcv9/dtrace", 0xFFBFE9F4, 0xFFBFEA0C)
argc = 5
14496: fork1() = 14498
14498: fork1() (returning as child ...) = 14496
14498: *** process otherwise traced, releasing ...
14496/2: Received signal #36, SIGCANCEL, in write() [caught]
14496/2: siginfo: SIGCANCEL pid=14496 uid=24484 code=-1
14495: Received signal #18, SIGCLD, in read() [caught]
14495: siginfo: SIGCLD CLD_EXITED pid=14496 status=0x0000
% ptree 14495
14162 gnome-terminal
14474 bash
14494 truss -f -texec,fork ./go
14495 /bin/ksh ./go
14496 <defunct>
% pflags 14495
14495: /bin/ksh ./go
data model = _ILP32 flags = FORK|RLC|ASYNC|MSACCT|MSFORK
flttrace = 0xfffffbff
sigtrace = 0xfffffeff 0xffffffff
HUP|INT|QUIT|ILL|TRAP|ABRT|EMT|FPE|BUS|SEGV|SYS|PIPE|ALRM|TERM|USR1|USR2|CLD|PWR|WINCH|URG|POLL|STOP|TSTP|CONT|TTIN|TTOU|VTALRM|PROF|XCPU|XFSZ|WAITING|LWP|FREEZE|THAW|CANCEL|LOST|XRES|JVM1|JVM2|RTMIN|RTMIN+1|RTMIN+2|RTMIN+3|RTMAX-3|RTMAX-2|RTMAX-1|RTMAX
entryset = 0x00000401 0x04000000 0x00000000 0x00000000
0x80000000 0x00000000 0x00000000 0x00000000
exitset = 0x00000416 0x04000000 0x00000000 0x00400000
0x40004000 0x00000000 0x00000000 0x00000001
/1: flags = ASLEEP read(0xa,0xffbfdf38,0x400)