rr-debugger / rr-debugger/rr

`Unexpected status 0x1057f (PTRACE_EVENT_FORK)` during diversion

Open
#2,970 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Description

Unfortunately, I don't know exactly what I did to get into this state, and it doesn't easily reproduce:

(rr) p jl_dump_llvm_value(0x7b2000007788)
; Function Attrs: allocsize(1)
declare noalias nonnull {} addrspace(10)* @ijl_gc_pool_alloc[FATAL /home/keno/rr/src/AutoRemoteSyscalls.cc:344:syscall_base()] 
 (task 1666792 (rec:1665936) at time 0)
 -> Assertion `false' failed to hold. Unexpected status 0x1057f (PTRACE_EVENT_FORK)
=== Start rr backtrace:
/home/keno/rr-build/bin/rr(_ZN2rr13dump_rr_stackEv+0x5d)[0x562107483876]
/home/keno/rr-build/bin/rr(_ZN2rr9GdbServer15emergency_debugEPNS_4TaskE+0x1a6)[0x5621072a7e4a]
/home/keno/rr-build/bin/rr(+0x39d2f6)[0x5621072db2f6]
/home/keno/rr-build/bin/rr(_ZN2rr21EmergencyDebugOstreamD1Ev+0x66)[0x5621072db560]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls12syscall_baseEiRNS_9RegistersE+0x96b)[0x5621072328bd]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi7EEEliRNS_9RegistersE+0x2c)[0x56210723adb6]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi6EmJEEEliRNS_9RegistersET0_DpT1_+0x43)[0x56210723ad2d]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi5EmJmEEEliRNS_9RegistersET0_DpT1_+0x49)[0x562107247807]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi4EmJmmEEEliRNS_9RegistersET0_DpT1_+0x54)[0x562107247730]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi3EmJmmmEEEliRNS_9RegistersET0_DpT1_+0x58)[0x562107247412]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi2EmJmmmmEEEliRNS_9RegistersET0_DpT1_+0x5f)[0x5621072470f7]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls14syscall_helperILi1EmJmmmmmEEEliRNS_9RegistersET0_DpT1_+0x5e)[0x562107246cce]
/home/keno/rr-build/bin/rr(_ZN2rr18AutoRemoteSyscalls7syscallIJmmmmmmEEEliDpT_+0xb8)[0x5621072464c4]
/home/keno/rr-build/bin/rr(+0x30593f)[0x56210724393f]
/home/keno/rr-build/bin/rr(+0x306d2b)[0x562107244d2b]
/home/keno/rr-build/bin/rr(+0x305a42)[0x562107243a42]
/home/keno/rr-build/bin/rr(_ZN2rr16DiversionSession14diversion_stepEPNS_4TaskENS_10RunCommandEi+0x616)[0x5621072440b2]
/home/keno/rr-build/bin/rr(_ZN2rr9GdbServer6divertERNS_13ReplaySessionE+0x31f)[0x5621072a3655]
/home/keno/rr-build/bin/rr(_ZN2rr9GdbServer25process_debugger_requestsENS0_11ReportStateE+0x1af)[0x5621072a3a6b]
/home/keno/rr-build/bin/rr(_ZN2rr9GdbServer14debug_one_stepERNS_10GdbRequestE+0x183)[0x5621072a484d]
/home/keno/rr-build/bin/rr(_ZN2rr9GdbServer12serve_replayERKNS0_15ConnectionFlagsE+0x54f)[0x5621072a6f15]
/home/keno/rr-build/bin/rr(+0x485456)[0x5621073c3456]
/home/keno/rr-build/bin/rr(_ZN2rr13ReplayCommand3runERSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE+0x404)[0x5621073c3ee0]
/home/keno/rr-build/bin/rr(main+0x21f)[0x56210749f77b]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fd62445d0b3]
/home/keno/rr-build/bin/rr(_start+0x2e)[0x5621071ff63e]
=== End rr backtrace

I tried some obvious things like p fork(), but that seems to not cause the same issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AutoRemoteSyscalls.cc:344 and trace the call from DiversionSession::diversion_step shown in the backtrace. Use the reported replay scenario if it can be reproduced, then investigate why PTRACE_EVENT_FORK reaches the assertion during diversion; done means the failure is reproduced and either prevented or covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.