rr-debugger / rr-debugger/rr

rr fails to record mach mochitest-devtools

Open
#1,425 1 comment 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

I built git master rr on x86-64 Fedora 20. I commented out the 32-bit tests (didn't want to install the 32-bit toolchain) but the 64-bit tests all pass.

I am building firefox fx-team. I've tried various configurations but all with this in .mozconfig:

ac_add_options --enable-devtools-perf

I tried to record a test run using:

./mach mochitest-devtools --slowscript --debugger rr  browser/devtools/performance/test/browser_perf-compatibility-04.js

This fails like:

[FATAL /home/tromey/firefox-git/rr/src/task.cc:562:fstat() errno: 13 'Permission denied']
 (task 26191 (rec:26191) at time 3637)
 ->  Assertion `backing_fd.is_open()' failed to hold.
[FATAL /home/tromey/firefox-git/rr/src/log.cc:16:emergency_debug() errno: 0 'Success']
 -> (session doesn't look interactive, aborting emergency debugging)

Re-running with rr in gdb, the backtrace is:

(gdb) bt
#0  0x00007ffff6ab101f in accept4 (fd=4, addr=..., addr_len=0x7fffffffae9c, 
    flags=-1) at ../sysdeps/unix/sysv/linux/accept4.c:37
#1  0x0000000000548ef7 in GdbConnection::await_debugger (this=0x6ab670, 
    listen_fd=...) at /home/tromey/firefox-git/rr/src/GdbConnection.cc:109
#2  0x0000000000549119 in GdbConnection::await_client_connection (
    desired_port=25814, probe=GdbConnection::PROBE_PORT, tgid=25814, 
    exe_image="", client_params_fd=0x0)
    at /home/tromey/firefox-git/rr/src/GdbConnection.cc:142
#3  0x0000000000554eed in GdbServer::emergency_debug (t=0x690c40)
    at /home/tromey/firefox-git/rr/src/GdbServer.cc:896
#4  0x000000000056cfd8 in emergency_debug (t=0x690c40)
    at /home/tromey/firefox-git/rr/src/log.cc:20
#5  0x000000000056d09a in EmergencyDebugOstream::~EmergencyDebugOstream (
    this=0x7fffffffd220, __in_chrg=<optimized out>)
    at /home/tromey/firefox-git/rr/src/log.cc:27
#6  0x00000000005e954f in Task::fstat (this=0x690c40, fd=9)
    at /home/tromey/firefox-git/rr/src/task.cc:562
#7  0x000000000058a827 in process_mmap (t=0x690c40, length=217032, prot=1, 
    flags=1, fd=9, offset_pages=0)
    at /home/tromey/firefox-git/rr/src/record_syscall.cc:2424
#8  0x000000000059470b in rec_process_syscall_arch<rr::X64Arch> (t=0x690c40, 
    syscall_state=...)
    at /home/tromey/firefox-git/rr/src/record_syscall.cc:2645
#9  0x000000000058b0a4 in rec_process_syscall_internal (t=0x690c40, 
    syscall_state=...)
    at /home/tromey/firefox-git/rr/src/record_syscall.cc:2805
#10 0x000000000058b0da in rec_process_syscall (t=0x690c40)
    at /home/tromey/firefox-git/rr/src/record_syscall.cc:2810
#11 0x0000000000580131 in RecordSession::syscall_state_changed (this=0x68f450, 
    t=0x690c40, step_state=0x7fffffffdeb0)
    at /home/tromey/firefox-git/rr/src/RecordSession.cc:531
#12 0x0000000000582ad1 in RecordSession::record_step (this=0x68f450)
    at /home/tromey/firefox-git/rr/src/RecordSession.cc:1065
#13 0x000000000057c12f in record (
    args=std::vector of length 5, capacity 8 = {...}, flags=...)
    at /home/tromey/firefox-git/rr/src/RecordCommand.cc:187
#14 0x000000000057c374 in RecordCommand::run (
    this=0x68ae40 <RecordCommand::singleton>, 
    args=std::vector of length 5, capacity 8 = {...})
    at /home/tromey/firefox-git/rr/src/RecordCommand.cc:233
#15 0x000000000056ea1e in main (argc=6, argv=0x7fffffffe128)
    at /home/tromey/firefox-git/rr/src/main.cc:241

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

Reproduce the failure with the shown mach mochitest-devtools command and inspect rr/src/task.cc at Task::fstat, then follow the mmap path in rr/src/record_syscall.cc. Use the provided backtrace and the GdbConnection emergency-debug path to determine why recording receives EACCES. Done means the test run records successfully without the assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.