[llvm-bugs] [Bug 35665] New: llvm-cov: segmentation fault while running large tests

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Dec 14 13:47:15 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35665

            Bug ID: 35665
           Summary: llvm-cov: segmentation fault while running large tests
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mmoroz at google.com
                CC: llvm-bugs at lists.llvm.org

Hello,

I'm experiencing some crashes when running unit tests for Chromium browser. I
wonder if you've ever seen anything similar. Any advice on how I can debug that
would be appreciated!

1) I'm running "unit_tests" binary built with coverage instrumentation:

$ ./unit_tests --test-launcher-jobs=1 --single-process-tests
<...>
[----------] 29 tests from ProfileManagerTest
[ RUN      ] ProfileManagerTest.GetProfile
[       OK ] ProfileManagerTest.GetProfile (9 ms)
[ RUN      ] ProfileManagerTest.DefaultProfileDir
[       OK ] ProfileManagerTest.DefaultProfileDir (2 ms)
[ RUN      ] ProfileManagerTest.CreateAndUseTwoProfiles
[       OK ] ProfileManagerTest.CreateAndUseTwoProfiles (124 ms)
[ RUN      ] ProfileManagerTest.LoadNonExistingProfile
[96483:96483:1214/134316.932977:879840876068:ERROR:profile_manager.cc(524)]
Loading a profile path that does not exist
[96483:96483:1214/134316.933075:879840876158:ERROR:profile_manager.cc(524)]
Loading a profile path that does not exist
[       OK ] ProfileManagerTest.LoadNonExistingProfile (2 ms)
[ RUN      ] ProfileManagerTest.LoadExistingProfile
Received signal 11 SEGV_MAPERR 0000000000a8
#0 0x0000163d4260 __llvm_coverage_mapping
#1 0x0000163d3c8e __llvm_coverage_mapping
#2 0x7f0af8dd9330 <unknown>
#3 0x00001a2ce51f __llvm_coverage_mapping
#4 0x00001635b488 __llvm_coverage_mapping
#5 0x0000162c165e __llvm_coverage_mapping
#6 0x00001f62f2c5 __llvm_coverage_mapping
#7 0x00001f62dae2 __llvm_coverage_mapping
#8 0x00001f6304cb __llvm_coverage_mapping
#9 0x00001f630178 __llvm_coverage_mapping
#10 0x000017832864 __llvm_coverage_mapping
#11 0x0000174744fe __llvm_coverage_mapping
#12 0x000013d19b3c __llvm_coverage_mapping
#13 0x0000163da302 __llvm_coverage_mapping
#14 0x00001648d42e __llvm_coverage_mapping
#15 0x00001648d9d2 __llvm_coverage_mapping
#16 0x00001648dd20 __llvm_coverage_mapping
#17 0x00001649d9c5 __llvm_coverage_mapping
#18 0x00001655c9c5 __llvm_coverage_mapping
#19 0x00000aa10dd0 __llvm_coverage_mapping
#20 0x000007d1d1d4 __llvm_coverage_mapping
#21 0x00000b94c40c __llvm_coverage_mapping
#22 0x00000b94e3ba __llvm_coverage_mapping
#23 0x00000b94fb41 __llvm_coverage_mapping
#24 0x00000b963328 __llvm_coverage_mapping
#25 0x00000b962aa7 __llvm_coverage_mapping
#26 0x000013d52b95 __llvm_coverage_mapping
#27 0x000013d5f3cc __llvm_coverage_mapping
#28 0x000013d5f17d __llvm_coverage_mapping
#29 0x000013d323f6 __llvm_coverage_mapping
#30 0x7f0af20c0f45 __libc_start_main
#31 0x000006b63029 __llvm_coverage_mapping
  r8: 00000000006751c3  r9: 0000000000000fe9 r10: 00000f4ee744fcc0 r11:
00007ffdeeb4d970
 r12: 0000000000001dc8 r13: 00000f4ee7c204e0 r14: 00007ffdeeb4db80 r15:
0000000000001dc8
  di: 00000000694fb5c8  si: 00007ffdeeb4d8e0  bp: 00007ffdeeb4da00  bx:
0000000000000000
  dx: 00007f0ae9e60000  ax: 0000000000001dc9  cx: 00000000003c4ad5  sp:
00007ffdeeb4d9e0
  ip: 000000001a2ce51f efl: 0000000000010206 cgf: 0000000000000033 erf:
0000000000000004
 trp: 000000000000000e msk: 0000000000000000 cr2: 00000000000000a8
[end of stack trace]
Calling _exit(1). Core file will not be generated.


2) I'm trying to run the test individually, it works fine:

$ unit_tests --test-launcher-jobs=1 --single-process-tests
--gtest_filter=*ProfileManagerTest.LoadExistingProfile*
Note: Google Test filter = *ProfileManagerTest.LoadExistingProfile*
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from ProfileManagerTest
[ RUN      ] ProfileManagerTest.LoadExistingProfile
[105901:105901:1214/134354.265754:879878208851:ERROR:profile_manager.cc(524)]
Loading a profile path that does not exist
[       OK ] ProfileManagerTest.LoadExistingProfile (14 ms)
[----------] 1 test from ProfileManagerTest (15 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (16 ms total)
[  PASSED  ] 1 test.


3) I'm trying to run a subset of tests, it also works fine:

$ unit_tests --test-launcher-jobs=1 --single-process-tests
--gtest_filter=*ProfileManagerTest*
Note: Google Test filter = *ProfileManagerTest*
[==========] Running 29 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 29 tests from ProfileManagerTest
<...>
[ RUN      ] ProfileManagerTest.LoadNonExistingProfile
[105956:105956:1214/134410.436573:879894379686:ERROR:profile_manager.cc(524)]
Loading a profile path that does not exist
[105956:105956:1214/134410.436681:879894379765:ERROR:profile_manager.cc(524)]
Loading a profile path that does not exist
[       OK ] ProfileManagerTest.LoadNonExistingProfile (3 ms)
[ RUN      ] ProfileManagerTest.LoadExistingProfile
[105956:105956:1214/134410.446674:879894389758:ERROR:profile_manager.cc(524)]
Loading a profile path that does not exist
[       OK ] ProfileManagerTest.LoadExistingProfile (11 ms)
<...>
[----------] 29 tests from ProfileManagerTest (410 ms total)

[----------] Global test environment tear-down
[==========] 29 tests from 1 test case ran. (410 ms total)
[  PASSED  ] 29 tests.


4) I'm trying to run the whole thing under GDB, it crashes, but with different
stacktrace:

[ RUN      ] ProfileManagerTest.LoadExistingProfile
[New Thread 0x7fffdc93e700 (LWP 115441)]
[New Thread 0x7fffdd13f700 (LWP 115440)]
[New Thread 0x7fffddb78700 (LWP 115439)]
[New Thread 0x7fffe2f74700 (LWP 115438)]
[New Thread 0x7fffe1504700 (LWP 115437)]
[New Thread 0x7fffe3880700 (LWP 115436)]
[New Thread 0x7fffdb93c700 (LWP 106852)]
[New Thread 0x7fffe4777700 (LWP 106843)]
[New Thread 0x7fffdee1c700 (LWP 106255)]
[New Thread 0x7fffdf61d700 (LWP 106254)]

Program received signal SIGSEGV, Segmentation fault.
0x000000001a2ce51f in IsRootWindow () at ../../ui/aura/window.h:148
warning: Source file is more recent than executable.
148     
(gdb) bt
#0  0x000000001a2ce51f in IsRootWindow () at ../../ui/aura/window.h:148
#1  GetRootWindow () at ../../ui/aura/window.cc:203
#2  0x000000001635b488 in InitNativeWidget () at
../../ui/views/widget/native_widget_aura.cc:216
#3  0x00000000162c165e in Init () at ../../ui/views/widget/widget.cc:336
#4  0x000000001f62f2c5 in Init () at
../../chrome/browser/ui/views/profiles/user_manager_view.cc:362
#5  0x000000001f62dae2 in OnSystemProfileCreated () at
../../chrome/browser/ui/views/profiles/user_manager_view.cc:291
#6  0x000000001f6304cb in Invoke<std::__1::unique_ptr<UserManagerView,
std::__1::default_delete<UserManagerView> >, base::AutoReset<bool>*, Profile*,
std::__1::basic_string<char> const&> () at ../../base/bind_internal.h:149
#7  0x000000001f630178 in MakeItSo<void (*
const&)(std::__1::unique_ptr<UserManagerView,
std::__1::default_delete<UserManagerView> >, base::AutoReset<bool>*, Profile*,
std::__1::basic_string<char> const&), std::__1::unique_ptr<UserManagerView,
std::__1::default_delete<UserManagerView> >, base::AutoReset<bool>*, Profile*,
std::__1::basic_string<char> const&> () at ../../base/bind_internal.h:277
#8  RunImpl<void (* const&)(std::__1::unique_ptr<UserManagerView,
std::__1::default_delete<UserManagerView> >, base::AutoReset<bool>*, Profile*,
std::__1::basic_string<char> const&),
std::__1::tuple<base::internal::PassedWrapper<std::__1::unique_ptr<UserManagerView,
std::__1::default_delete<UserManagerView> > >,
base::internal::OwnedWrapper<base::AutoReset<bool> > > const&, 0, 1> () at
../../base/bind_internal.h:349
#9  0x0000000017832864 in Run () at ../../base/callback.h:92
#10 OnUserManagerSystemProfileCreated () at
../../chrome/browser/profiles/profile_window.cc:163
#11 0x00000000174744fe in Run () at ../../base/callback.h:92
#12 RunCallbacks () at ../../chrome/browser/profiles/profile_manager.cc:1648
#13 OnProfileCreated () at
../../chrome/browser/profiles/profile_manager.cc:1190
#14 0x0000000013d19b3c in FinishInit () at
../../chrome/test/base/testing_profile.cc:542
#15 0x00000000163da302 in Run () at ../../base/callback.h:64
#16 RunTask () at ../../base/debug/task_annotator.cc:57
#17 0x000000001648d42e in RunTask () at
../../base/message_loop/message_loop.cc:392
#18 0x000000001648d9d2 in DeferOrRunPendingTask () at
../../base/message_loop/message_loop.cc:404
#19 0x000000001648dd20 in DoWork () at
../../base/message_loop/message_loop.cc:450
#20 0x000000001649d9c5 in
base::MessagePumpGlib::Run(base::MessagePump::Delegate*) () at
../../base/message_loop/message_pump_glib.cc:313
#21 0x000000001655c9c5 in Run () at ../../base/run_loop.cc:118
#22 RunUntilIdle () at ../../base/run_loop.cc:131
#23 0x000000000aa10dd0 in RunAllTasksUntilIdle () at
../../content/public/test/test_utils.cc:167
#24 0x0000000007d1d1d4 in TestBody () at
../../chrome/browser/profiles/profile_manager_unittest.cc:426
#25 0x000000000b94c40c in Run () at
../../third_party/googletest/src/googletest/src/gtest.cc:2456
#26 0x000000000b94e3ba in Run () at
../../third_party/googletest/src/googletest/src/gtest.cc:2654
#27 0x000000000b94fb41 in Run () at
../../third_party/googletest/src/googletest/src/gtest.cc:2772
#28 0x000000000b963328 in RunAllTests () at
../../third_party/googletest/src/googletest/src/gtest.cc:4677
#29 0x000000000b962aa7 in
HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>
() at ../../third_party/googletest/src/googletest/src/gtest.cc:2400
#30 HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>
() at ../../third_party/googletest/src/googletest/src/gtest.cc:2453
#31 Run () at ../../third_party/googletest/src/googletest/src/gtest.cc:4285
#32 0x0000000013d52b95 in RUN_ALL_TESTS () at
../../third_party/googletest/src/googletest/include/gtest/gtest.h:2237
#33 Run () at ../../base/test/test_suite.cc:270
#34 0x0000000013d5f3cc in Run () at ../../base/callback.h:92
#35 LaunchUnitTestsInternal () at
../../base/test/launcher/unit_test_launcher.cc:216
#36 0x0000000013d5f17d in LaunchUnitTests () at
../../base/test/launcher/unit_test_launcher.cc:475
#37 0x0000000013d323f6 in main () at
../../chrome/test/base/run_all_unittests.cc:30




It feels like our tests can be doing some weird things, but still have no clue
what's the best way to figure that out.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171214/b68497fa/attachment-0001.html>


More information about the llvm-bugs mailing list