rr-debugger / rr

Record and Replay Framework
http://rr-project.org/
Other
9.18k stars 585 forks source link

rr 5.0.0 fails on WSL on Ubuntu 16.04 on Windows 10 1709 #2118

Closed nth10sd closed 7 years ago

nth10sd commented 7 years ago

It is possible to run firefox on Ubuntu 16.04 WSL Win10 1709 with Xming installed as a X11 server on Windows, but running it with rr 5.0.0 fails with the following stack:

$ rr record firefox
rr: Saving execution to trace directory `/home/winworklin/.local/share/rr/firefox-2'.
[FATAL /home/roc/rr/rr/src/Task.cc:2650:spawn() errno: EINVAL] PTRACE_SEIZE failed for tid 10609
=== Start rr backtrace:
rr(_ZN2rr13dump_rr_stackEv+0x28)[0x554cb8]
rr(_ZN2rr15notifying_abortEv+0x47)[0x554d37]
rr(_ZN2rr4Task5spawnERNS_7SessionERKNS_8ScopedFdERKNS_11TraceStreamERKSsRKSt6vectorISsSaISsEESF_i+0x707)[0x540067]
rr(_ZN2rr13RecordSessionC1ERKSsRKSt6vectorISsSaISsEES7_NS0_16SyscallBufferingENS_7BindCPUE+0x1ad)[0x4c4cdd]
rr(_ZN2rr13RecordSession6createERKSt6vectorISsSaISsEES5_NS0_16SyscallBufferingENS_7BindCPUE+0x7d5)[0x4c5655]
rr(_ZN2rr13RecordCommand3runERSt6vectorISsSaISsEE+0x944)[0x4bc164]
rr(main+0x244)[0x44f2e4]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fa48a350830]
rr[0x44f7cf]
=== End rr backtrace
Aborted (core dumped)

I am on Dell XPS 15 with Kaby Lake Core i7-7700HQ.

Might this be a possible supported use case in the future?

nth10sd commented 7 years ago

The stack with rr from 16.04 apt-get is version 4.1.0 and shows the following error:

$ rr record firefox
rr: Saving the execution of `firefox' to trace directory `/home/winworklin/.local/share/rr/firefox-0'.
[FATAL /build/rr-jR8ti5/rr-4.1.0/src/task.cc:3223:spawn() errno: 22 'Invalid argument'] 
 -> PTRACE_SEIZE failed for tid 9636
Aborted (core dumped)
khuey commented 7 years ago

WSL's "kernel" doesn't have a complete ptrace implementation, and it doesn't have a seccomp implementation at all as far as I can tell. They might get there some day but until then this won't be possible. (And if they do get there, rr should Just Work (TM))

luser commented 6 years ago

I opened a WSL issue on PTRACE_SEIZE not working: https://github.com/Microsoft/WSL/issues/3031 . That seems like a specific, tractable thing that they could fix. seccomp is a whole other ball of wax, for sure.

rocallahan commented 6 years ago

Thanks. There are a lot of other bits and pieces they'd have to implement/fix though.