Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNIT_Helpers_TEST seg-fault on macOS #360

Closed
scpeters opened this issue Mar 1, 2022 · 1 comment
Closed

UNIT_Helpers_TEST seg-fault on macOS #360

scpeters opened this issue Mar 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working macOS macOS support tests Broken or missing tests / testing infra

Comments

@scpeters
Copy link
Member

scpeters commented Mar 1, 2022

Environment

  • OS Version: test locally on 10.15.7-x86_64 (Catalina), failures observed also with 11.6 (Big Sur)
  • Source or binary build? source build of main branch

Description

  • Expected behavior: `UNIT_Helpers_TEST passes
  • Actual behavior: the test seg-faults during HelpersTest.findFirstByProperty

This test failure was discussed in #346 (comment)

$ bin/UNIT_Helpers_TEST 
Running main() from /Users/scpeters/ws/garden/src/ign-gui/test/gtest/src/gtest_main.cc
[==========] Running 7 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 7 tests from HelpersTest
[ RUN      ] HelpersTest.humanReadable
[       OK ] HelpersTest.humanReadable (0 ms)
[ RUN      ] HelpersTest.unitFromKey
[       OK ] HelpersTest.unitFromKey (0 ms)
[ RUN      ] HelpersTest.rangeFromKey
[       OK ] HelpersTest.rangeFromKey (0 ms)
[ RUN      ] HelpersTest.stringTypeFromKey
[       OK ] HelpersTest.stringTypeFromKey (0 ms)
[ RUN      ] HelpersTest.findFirstByProperty
Segmentation fault: 11
$ 

Steps to reproduce

  1. Build main branch
  2. run bin/UNIT_Helpers_TEST

Output

It was tricky to collect a backtrace on my laptop, since it didn't fail when run interactively with lldb, though it did have some unusual console messages:

$ lldb bin/UNIT_Helpers_TEST 
(lldb) target create "bin/UNIT_Helpers_TEST"
Current executable set to '/Users/scpeters/ws/garden/src/ign-gui/build/bin/UNIT_Helpers_TEST' (x86_64).
(lldb) r
Process 16468 launched: '/Users/scpeters/ws/garden/src/ign-gui/build/bin/UNIT_Helpers_TEST' (x86_64)
Running main() from /Users/scpeters/ws/garden/src/ign-gui/test/gtest/src/gtest_main.cc
[==========] Running 7 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 7 tests from HelpersTest
[ RUN      ] HelpersTest.humanReadable
[       OK ] HelpersTest.humanReadable (0 ms)
[ RUN      ] HelpersTest.unitFromKey
[       OK ] HelpersTest.unitFromKey (0 ms)
[ RUN      ] HelpersTest.rangeFromKey
[       OK ] HelpersTest.rangeFromKey (0 ms)
[ RUN      ] HelpersTest.stringTypeFromKey
[       OK ] HelpersTest.stringTypeFromKey (0 ms)
[ RUN      ] HelpersTest.findFirstByProperty
2022-03-01 11:48:58.306190-0800 UNIT_Helpers_TEST[16468:23357573] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=16468
2022-03-01 11:48:58.306232-0800 UNIT_Helpers_TEST[16468:23357573] SecTaskCopyDebugDescription: UNIT_Helpers_TES[16468]/0#-1 LF=0
2022-03-01 11:48:58.344235-0800 UNIT_Helpers_TEST[16468:23357573] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=16468
2022-03-01 11:48:58.344364-0800 UNIT_Helpers_TEST[16468:23357573] SecTaskCopyDebugDescription: UNIT_Helpers_TES[16468]/0#-1 LF=0
2022-03-01 11:48:58.758389-0800 UNIT_Helpers_TEST[16468:23357492] SecTaskLoadEntitlements failed error=22 cs_flags=20, pid=16468
2022-03-01 11:48:58.758479-0800 UNIT_Helpers_TEST[16468:23357492] SecTaskCopyDebugDescription: UNIT_Helpers_TES[16468]/0#-1 LF=0
[       OK ] HelpersTest.findFirstByProperty (1667 ms)
[ RUN      ] HelpersTest.worldNames
[       OK ] HelpersTest.worldNames (161 ms)
[ RUN      ] HelpersTest.renderEngine
[       OK ] HelpersTest.renderEngine (141 ms)
[----------] 7 tests from HelpersTest (1969 ms total)

[----------] Global test environment tear-down
[==========] 7 tests from 1 test case ran. (1969 ms total)
[  PASSED  ] 7 tests.
Process 16468 exited with status = 0 (0x00000000) 
(lldb)

I managed to collect a backtrace by setting ulimit -c unlimited and ensuring the /cores had write permissions enabled:

$ bin/UNIT_Helpers_TEST 
Running main() from /Users/scpeters/ws/garden/src/ign-gui/test/gtest/src/gtest_main.cc
[==========] Running 7 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 7 tests from HelpersTest
[ RUN      ] HelpersTest.humanReadable
[       OK ] HelpersTest.humanReadable (0 ms)
[ RUN      ] HelpersTest.unitFromKey
[       OK ] HelpersTest.unitFromKey (0 ms)
[ RUN      ] HelpersTest.rangeFromKey
[       OK ] HelpersTest.rangeFromKey (0 ms)
[ RUN      ] HelpersTest.stringTypeFromKey
[       OK ] HelpersTest.stringTypeFromKey (0 ms)
[ RUN      ] HelpersTest.findFirstByProperty
Segmentation fault: 11
OSRF-macbook-pro-15:build scpeters$ lldb -c /cores/core.16722 
(lldb) target create --core "/cores/core.16722"
Core file '/cores/core.16722' (x86_64) was loaded.

(lldb) bt
* thread #1, stop reason = signal SIGSTOP
  * frame #0: 0x00007fff68edc0c6 libsystem_c.dylib`strrchr + 10
    frame #1: 0x000000010ffa627b QtCore`QCoreApplicationPrivate::appName() const + 203
    frame #2: 0x000000010ffa849e QtCore`QCoreApplicationPrivate::init() + 94
    frame #3: 0x000000010f7eba49 QtGui`QGuiApplicationPrivate::init() + 57
    frame #4: 0x000000010f20edaa QtWidgets`QApplicationPrivate::init() + 26
    frame #5: 0x000000010df44892 libignition-gui7.7.0.0~pre1.dylib`ignition::gui::Application::Application(this=0x00007ffee1d5f8f8, _argc=<unavailable>, _argv=<unavailable>, _type=kMainWindow) at Application.cc:88:5 [opt]
    frame #6: 0x000000010deb07c0 UNIT_Helpers_TEST`HelpersTest_findFirstByProperty_Test::TestBody(this=<unavailable>) at Helpers_TEST.cc:125:15 [opt]
    frame #7: 0x000000010dec56ac UNIT_Helpers_TEST`void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) [inlined] void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(object=<unavailable>, method=<unavailable>, location=<unavailable>)(), char const*) at gtest.cc:2447:10 [opt]
    frame #8: 0x000000010dec569c UNIT_Helpers_TEST`void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(object=<unavailable>, method=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="the test body")(), char const*) at gtest.cc:2483 [opt]
    frame #9: 0x000000010dec55a1 UNIT_Helpers_TEST`testing::Test::Run(this=0x00007fd10c433640) at gtest.cc:2521:5 [opt]
    frame #10: 0x000000010dec6825 UNIT_Helpers_TEST`testing::TestInfo::Run(this=0x00007fd10c438bf0) at gtest.cc:2697:11 [opt]
    frame #11: 0x000000010dec7337 UNIT_Helpers_TEST`testing::TestCase::Run(this=0x00007fd10c438730) at gtest.cc:2815:28 [opt]
    frame #12: 0x000000010ded3907 UNIT_Helpers_TEST`testing::internal::UnitTestImpl::RunAllTests(this=<unavailable>) at gtest.cc:5181:43 [opt]
    frame #13: 0x000000010ded33fc UNIT_Helpers_TEST`bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) [inlined] bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=<unavailable>, method=<unavailable>, location="auxiliary test code (environments or event listeners)")(), char const*) at gtest.cc:2447:10 [opt]
    frame #14: 0x000000010ded33ec UNIT_Helpers_TEST`bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=<unavailable>, method=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="auxiliary test code (environments or event listeners)")(), char const*) at gtest.cc:2483 [opt]
    frame #15: 0x000000010ded336c UNIT_Helpers_TEST`testing::UnitTest::Run(this=0x000000010def4718) at gtest.cc:4790:10 [opt]
    frame #16: 0x000000010dee4c6a UNIT_Helpers_TEST`main [inlined] RUN_ALL_TESTS() at gtest.h:2341:46 [opt]
    frame #17: 0x000000010dee4c5d UNIT_Helpers_TEST`main(argc=1, argv=<unavailable>) at gtest_main.cc:36 [opt]
    frame #18: 0x00007fff68e35cc9 libdyld.dylib`start + 1
(lldb)
@scpeters scpeters added the bug Something isn't working label Mar 1, 2022
@chapulina chapulina self-assigned this Mar 1, 2022
@chapulina chapulina added macOS macOS support tests Broken or missing tests / testing infra labels Mar 1, 2022
@scpeters
Copy link
Member Author

scpeters commented Mar 2, 2022

I think this was fixed by #361. I'll close for now but will reopen if it persists

@scpeters scpeters closed this as completed Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS macOS support tests Broken or missing tests / testing infra
Projects
None yet
Development

No branches or pull requests

2 participants