rr-debugger / rr

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

rr record hangs on DCHECK failures on Chromium's blink_unittests #3382

Open andreubotella opened 2 years ago

andreubotella commented 2 years ago

Chromium has a binary blink_unittests that runs a number of tests for Blink with gtest, and rr record hangs whenever it hits an assertion failure (with DCHECK). The log showing the cause of the assertion failure is printed, but the hang seems to happen before the stack trace can be printed.

To reproduce, try adding a dummy test to some of the unit test files under third_party/blink. For example, with third_party/blink/renderer/core/layout/layout_table_test.cc, add the following:

TEST_F(LayoutTableTest, DummyTestForRr) {
  DCHECK(false);
}

Then compile with autoninja -C out/Default blink_tests and record with rr record ./out/Default/blink_unittests --gtest_filter="LayoutTableTest.DummyTestForRr".

rocallahan commented 2 years ago

I tried reproducing this. Seems to work OK for me.

rocallahan@rocallahan-p520:~/chromium/src$ rr record ./out/Default/blink_unittests --gtest_filter="LayoutTableTest.DummyTestForRr"
rr: Saving execution to trace directory `/usr/local/google/home/rocallahan/.local/share/rr/blink_unittests-0'.
Debugger detected, switching to single process mode.
Pass --test-launcher-debug-launcher to debug the launcher itself.
Detected presence of a debugger, running without test timeouts.
Note: Google Test filter = LayoutTableTest.DummyTestForRr
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from LayoutTableTest
[ RUN      ] LayoutTableTest.DummyTestForRr
FATAL blink_unittests[3258093:3258093]: [layout_table_test.cc(49)] Check failed: false. 
Trace/breakpoint trap
rocallahan@rocallahan-p520:~/chromium/src$ rr replay -a
Debugger detected, switching to single process mode.
Pass --test-launcher-debug-launcher to debug the launcher itself.
Detected presence of a debugger, running without test timeouts.
Note: Google Test filter = LayoutTableTest.DummyTestForRr
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from LayoutTableTest
[ RUN      ] LayoutTableTest.DummyTestForRr
FATAL blink_unittests[3258093:3258093]: [layout_table_test.cc(49)] Check failed: false. 

rr revision e4206a72d10bfb409e225da2371e77df51c20218 (latest).

rocallahan commented 2 years ago

Here's my args.gn:

target_os = "chromeos"
use_goma = true            # Googlers: Use build farm, compiles faster.
is_component_build = true  # Links faster.
is_debug = false           # Release build, runs faster.
enable_nacl = false        # Skips native client build, compiles faster.
is_chrome_branded = false  # Adds internal features and branded art assets.
is_official_build = false  # Turns on many optimizations, slower build.
symbol_level=2
andreubotella commented 2 years ago

It seems to have been fixed in e77b5f8.

khuey commented 2 years ago

If you weren't recording with --chaos https://github.com/rr-debugger/rr/commit/e77b5f8ca4b360daffd31cf72cb6b093fa9e0b62 didn't change anything.

andreubotella commented 2 years ago

If you weren't recording with --chaos e77b5f8 didn't change anything.

I was trying to run rr on a test with a failed DCHECK, and rr record happened to not hang, so I closed this bug, maybe too eagerly. Trying the LayoutTableTest example above does still hang. Neither of those cases were with --chaos.

rocallahan commented 2 years ago

So you're saying the test that worked for me still doesn't work for you?

Does your args.gn match mine?

If you attach a debugger to rr when things have hung, and ask for a stack trace of rr, what do you get?