WSL icon indicating copy to clipboard operation
WSL copied to clipboard

strace (4.12) cannot run

Open mzzzoozz opened this issue 10 years ago • 5 comments

strace-4.12 will stop responding after run

here is strace log:

cc@DESKTOP-FRVEL9A:~$ cd strace-4.12/ cc@DESKTOP-FRVEL9A:~/strace-4.12$ strace -dv ./strace echo strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature. PTRACE_SEIZE doesn't work new tcb for pid 23, active tcbs:1 [wait(0x137f) = 23] WIFSTOPPED,sig=SIGSTOP pid 23 has TCB_STARTUP, initializing it ignored SIGSTOP on pid 23 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP execve("./strace", ["./strace", "echo"], ["TERM=xterm", "SHELL=/bin/bash", "NAME=DESKTOP-FRVEL9A", "USER=cc", "LS_COLORS=rs=0:di=01;34:ln=01;36"..., "HOSTTYPE=x86_64", "PATH=/usr/local/bin:/usr/bin:/bi"..., "PWD=/home/cc/strace-4.12", "LANG=en_US.UTF-8", "HOME=/home/cc", "SHLVL=2", "LOGNAME=cc", "LESSOPEN=| /usr/bin/lesspipe %s", "LESSCLOSE=/usr/bin/lesspipe %s %"..., "OLDPWD=/home/cc", "_=/usr/bin/strace"] [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP not a syscall entry (rax = 0) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP brk(0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x76e000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP access("/etc/ld.so.nohwcap", F_OK [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = -1 ENOENT (No such file or directory) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f5137980000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP access("/etc/ld.so.preload", R_OK [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = -1 ENOENT (No such file or directory) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 3 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP fstat(3, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP {st_dev=makedev(0, 1), st_ino=3940649674062820, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=512, st_blocks=48, st_size=21502, st_atime=2016/06/16-19:22:18, st_mtime=2016/06/16-19:22:18, st_ctime=2016/06/16-19:22:18}) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(NULL, 21502, PROT_READ, MAP_PRIVATE, 3, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f513797a000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP close(3 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP access("/etc/ld.so.nohwcap", F_OK [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = -1 ENOENT (No such file or directory) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 3 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP read(3, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P \2\0\0\0\0\0"..., 832) = 832 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP fstat(3, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP {st_dev=makedev(0, 1), st_ino=4222124650767151, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=512, st_blocks=3600, st_size=1840928, st_atime=2016/06/16-19:20:50, st_mtime=2016/05/26-03:30:14, st_ctime=2016/06/16-19:20:52}) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(NULL, 3949248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f5137230000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mprotect(0x7f51373ea000, 2097152, PROT_NONE [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(0x7f51375ea000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f51375ea000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(0x7f51375f0000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f51375f0000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP close(3 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f5137970000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x7f5137960000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP arch_prctl(ARCH_SET_FS, 0x7f5137960740 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mprotect(0x7f51375ea000, 16384, PROT_READ [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mprotect(0x688000, 4096, PROT_READ [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP mprotect(0x7f5137822000, 4096, PROT_READ [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP munmap(0x7f513797a000, 21502 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGCHLD, {SIG_DFL, [CHLD], SA_RESTORER|SA_RESTART, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP {SIG_DFL, [CHLD], SA_RESTORER|SA_RESTART, 0x7fe2dae66cb0}, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP getpid( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 23 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP uname( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP {sysname="Linux", nodename="DESKTOP-FRVEL9A", release="3.4.0+", version="#1 PREEMPT Thu Aug 1 17:06:05 CST 2013", machine="x86_64", domainname="localdomain"}) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP brk(0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x76e000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP brk(0x78f000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0x78f000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP getuid( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 1000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP getgid( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 1000 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP clone( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f5137960a10) = 24 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ptrace(PTRACE_SEIZE, 24, 0, 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = -1 EINVAL (Invalid argument) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP kill(24, SIGKILL [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP wait4(24, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP [{WIFSIGNALED(s) && WTERMSIG(s) == SIGKILL}], 0, NULL) = 24 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP fcntl(0, F_GETFD [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP fcntl(1, F_GETFD [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP stat("/usr/local/bin/echo", [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP 0x7fffc2a58ab0) = -1 ENOENT (No such file or directory) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP stat("/usr/bin/echo", [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP 0x7fffc2a58ab0) = -1 ENOENT (No such file or directory) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP stat("/bin/echo", [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP {st_dev=makedev(0, 1), st_ino=4222124650701734, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=512, st_blocks=64, st_size=31296, st_atime=2016/03/10-11:10:57, st_mtime=2016/03/10-11:10:57, st_ctime=2016/03/10-11:10:57}) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP stat("/bin/echo", [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP {st_dev=makedev(0, 1), st_ino=4222124650701734, st_mode=S_IFREG|0755, st_nlink=1, st_uid=0, st_gid=0, st_blksize=512, st_blocks=64, st_size=31296, st_atime=2016/03/10-11:10:57, st_mtime=2016/03/10-11:10:57, st_ctime=2016/03/10-11:10:57}) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP clone( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f5137960a10) = 25 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP close(0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP pipe( [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP [0, 3]) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP close(3 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP dup2(0, 1 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 1 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGTTOU, {SIG_IGN, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGTTIN, {SIG_IGN, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGHUP, {0x417f20, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGINT, {0x417f20, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGQUIT, {0x417f20, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGPIPE, {0x417f20, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigaction(SIGTERM, {0x417f20, [], SA_RESTORER, 0x7f5137266cb0}, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT PIPE TERM], [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigprocmask(SIG_SETMASK, [], [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigprocmask(SIG_SETMASK, [], [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP wait4(-1, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSTOP}], __WALL, NULL) = 25 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT PIPE TERM], [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP NULL, 8) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ptrace(PTRACE_GETREGSET, 25, NT_PRSTATUS, [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP [{0x690900, 216}]) = -1 EINVAL (Invalid argument) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ptrace(PTRACE_GETREGS, 25, 0, 0x690900 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ptrace(PTRACE_SETOPTIONS, 25, 0, PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = -1 EINVAL (Invalid argument) [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP write(2, "./strace: PTRACE_SETOPTIONS: Inv"..., 46./strace: PTRACE_SETOPTIONS: Invalid argument [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 46 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP kill(25, SIGCONT [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP kill(25, SIGTERM [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP ) = 0 [wait(0x057f) = 23] WIFSTOPPED,sig=SIGTRAP wait4(25,

mzzzoozz avatar Jun 17 '16 07:06 mzzzoozz

I tried to run strace -dv strace echo manually it seemed to exit fine on an internal build. Are you trying to use a specific version of strace?

dethoma avatar Jun 21 '16 21:06 dethoma

@dethoma yes, WSL's(same as Ubuntu 14.04) default strace is 4.8, it run properly. But more recent strace(such as my example, 4.12) stop response. I guess this scenario similar to #555 , WSL's PTRACE not work correctly on fork and clone.

BTW: WSL print "Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature." But Ubuntu not.

mzzzoozz avatar Jun 22 '16 14:06 mzzzoozz

@dethoma strace 4.12 work correctly on 14371

mzzzoozz avatar Jun 23 '16 04:06 mzzzoozz

@mzzzoozz - Thanks for validating on 14371. Since it is working for you, can we close this issue out?

sunilmut avatar Jun 23 '16 19:06 sunilmut

Closing this out, if you continue to have issues with strace feel free to reopen.

benhillis avatar Jun 24 '16 18:06 benhillis