rr-debugger / rr-debugger/rr

20x slowdown recording Firefox `SandboxBrokerTest.MultiThread*` unit tests

Open
#2,159 3 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

The Firefox GTests SandboxBrokerTest.MultiThreadOpen and SandboxBrokerTest.MultiThreadStat run 20x slower than native (constrained to one core) when being recorded with rr 5.1.0.

These are unit tests of the Linux sandbox file broker; seccomp-bpf is not involved. They construct a broker instance and send it a lot of requests from several threads at once in a tight loop, within the same process. (And they're the least unreliable reproducer we have for a mysterious intermittent bug.) For each request, a socketpair is created and one end is sent to the broker with SCM_RIGHTS to carry the response.

I'm not surprised that rr has to do nontrivial work for this, and it's probably not something a normal application would do on the critical path, but this is a lot of slowdown.

For reference, the command I've been running is MOZ_RUN_GTEST=True GTEST_FILTER=SandboxBrokerTest.MultiThread\* rr record obj-x86_64-pc-linux-gnu/dist/bin/firefox -unittest, and I'm using a non-debug build.

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 slowdown with the stated MOZ_RUN_GTEST, GTEST_FILTER, and rr record command, comparing native and recorded runs of SandboxBrokerTest.MultiThreadOpen and SandboxBrokerTest.MultiThreadStat. Trace the Linux sandbox file-broker test path and rr's handling of the socketpair and SCM_RIGHTS activity; done should include a measured explanation and a validated improvement or a documented limitation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.