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

SIGSEGV in 0.24.0's IftypeTest.Codegen_True test on FreeBSD 11 #2825

Closed
slfritchie opened this issue Jul 16, 2018 · 5 comments
Closed

SIGSEGV in 0.24.0's IftypeTest.Codegen_True test on FreeBSD 11 #2825

slfritchie opened this issue Jul 16, 2018 · 5 comments

Comments

@slfritchie
Copy link
Contributor

Howdy, I noticed this today while trying to run tests (using build option config=release or config=debug, both crash) on 11.1-RELEASE and LLVM 3.9.1 at ponyc's tag 0.24.0.

[ RUN      ] IftypeTest.TupleCond_InvalidCardinality
[       OK ] IftypeTest.TupleCond_InvalidCardinality (2 ms)
[ RUN      ] IftypeTest.Codegen_True
gmake: *** [Makefile:919: test] Segmentation fault (core dumped)

It's a surprising pain to get a core dump with useful symbols in it. I hacked the Makefile to add a -g flag for compiling & linking everything (and using make verbose=true to try to verify that -g is being added at compilation & linking steps). Very little luck. A debug version of libponyc.tests includes no app symbols; the release version contains 1 symbol from iftype.cc. Perhaps there's one little trick that I don't know but the Internet can tell me about.

(lldb) bt all
* thread #1, name = 'libponyc.tests', stop reason = signal SIGSEGV
  * frame #0: 0x0000000803e98785 libgcc_s.so.1`___lldb_unnamed_symbol25$$libgcc_s.so.1 + 69
    frame #1: 0x0000000803e986e8 libgcc_s.so.1`___lldb_unnamed_symbol24$$libgcc_s.so.1 + 2664
    frame #2: 0x0000000803e97323 libgcc_s.so.1`_Unwind_Find_FDE + 243
    frame #3: 0x0000000803e909ad libgcc_s.so.1`___lldb_unnamed_symbol9$$libgcc_s.so.1 + 109
    frame #4: 0x0000000803e90ed8 libgcc_s.so.1`___lldb_unnamed_symbol10$$libgcc_s.so.1 + 152
    frame #5: 0x0000000803e912d6 libgcc_s.so.1`_Unwind_ForcedUnwind + 54
    frame #6: 0x0000000803369613 libthr.so.3`___lldb_unnamed_symbol174$$libthr.so.3 + 483
    frame #7: 0x000000080336942b libthr.so.3`pthread_exit + 11
    frame #8: 0x000000080335bbcd libthr.so.3`___lldb_unnamed_symbol1$$libthr.so.3 + 333
  thread #2, name = 'libponyc.tests', stop reason = signal SIGSEGV
    frame #0: 0x0000000803369c7c libthr.so.3`___lldb_unnamed_symbol180$$libthr.so.3 + 92
    frame #1: 0x00000000008a7e8b libponyc.tests
    frame #2: 0x00000000008a9d22 libponyc.tests
    frame #3: 0x00000000008a8980 libponyc.tests
    frame #4: 0x00000000008aa068 libponyc.tests
    frame #5: 0x0000000802d9a905
    frame #6: libponyc.tests`IftypeTest_Codegen_True_Test::TestBody(this=0x0000000804a16000) at iftype.cc:202
    frame #7: 0x00000000008cf98e libponyc.tests
    frame #8: 0x00000000008b84fe libponyc.tests
    frame #9: 0x00000000008b9932 libponyc.tests
    frame #10: 0x00000000008b9fd7 libponyc.tests
    frame #11: 0x00000000008c248a libponyc.tests
    frame #12: 0x00000000008d04ae libponyc.tests
    frame #13: 0x00000000008c1cb3 libponyc.tests
    frame #14: 0x0000000000891d13 libponyc.tests
    frame #15: 0x00000000007328ef libponyc.tests`_start + 383
  thread #3, name = 'libponyc.tests', stop reason = signal SIGSEGV
    frame #0: 0x0000000803369c7c libthr.so.3`___lldb_unnamed_symbol180$$libthr.so.3 + 92
    frame #1: 0x00000000008a7e8b libponyc.tests
    frame #2: 0x000000000089ca35 libponyc.tests
    frame #3: 0x00000000008a8d02 libponyc.tests
    frame #4: 0x000000080335bbc5 libthr.so.3`___lldb_unnamed_symbol1$$libthr.so.3 + 325
  thread #4, name = 'libponyc.tests', stop reason = signal SIGSEGV
    frame #0: 0x0000000804185788 libc.so.7`_sigwait + 8
    frame #1: 0x0000000803361751 libthr.so.3`___lldb_unnamed_symbol98$$libthr.so.3 + 97
    frame #2: 0x00000000008a7eef libponyc.tests
    frame #3: 0x00000000008a9c5c libponyc.tests
    frame #4: 0x00000000008a8fc0 libponyc.tests
    frame #5: 0x000000080335bbc5 libthr.so.3`___lldb_unnamed_symbol1$$libthr.so.3 + 325
@slfritchie
Copy link
Contributor Author

FWIW, this bug was introduced at commit 41b80ee according to git bisect in release 0.22.0: "Switch from MCJIT to ORC JIT (#2518)"

@SeanTAllen
Copy link
Member

Once this is fixed, we can add FreeBSD 11 x86-64 to the list of supported platforms

@slfritchie
Copy link
Contributor Author

FWIW, I also see this at the 0.25.0 release tag on FreeBSD 11.

* thread #1, name = 'libponyc.tests', stop reason = signal SIGSEGV
  * frame #0: 0x0000000804227785 libgcc_s.so.1`___lldb_unnamed_symbol25$$libgcc_s.so.1 + 69
    frame #1: 0x00000008042276e8 libgcc_s.so.1`___lldb_unnamed_symbol24$$libgcc_s.so.1 + 2664
    frame #2: 0x0000000804226323 libgcc_s.so.1`_Unwind_Find_FDE + 243
    frame #3: 0x000000080421f9ad libgcc_s.so.1`___lldb_unnamed_symbol9$$libgcc_s.so.1 + 109
    frame #4: 0x000000080421fed8 libgcc_s.so.1`___lldb_unnamed_symbol10$$libgcc_s.so.1 + 152
    frame #5: 0x00000008042202d6 libgcc_s.so.1`_Unwind_ForcedUnwind + 54
    frame #6: 0x00000008036f8613 libthr.so.3`___lldb_unnamed_symbol174$$libthr.so.3 + 483
    frame #7: 0x00000008036f842b libthr.so.3`pthread_exit + 11
    frame #8: 0x00000008036eabcd libthr.so.3`___lldb_unnamed_symbol1$$libthr.so.3 + 333
  thread #2, name = 'libponyc.tests', stop reason = signal SIGSEGV
    frame #0: 0x00000008036f8c7c libthr.so.3`___lldb_unnamed_symbol180$$libthr.so.3 + 92
    frame #1: libponyc.tests`ponyint_thread_join(thread=0x0000000814ed0a00) at threads.c:220
    frame #2: libponyc.tests`ponyint_sched_shutdown at scheduler.c:947
    frame #3: libponyc.tests`ponyint_sched_start(library=false) at scheduler.c:1083
    frame #4: libponyc.tests`pony_start(library=false, exit_code=0x0000000000000000, language_features=0x00007fffffffd4b0) at start.c:195
    frame #5: 0x00000008031a9905
    frame #6: libponyc.tests`PassTest::run_program(this=0x0000000804c22140, exit_code=0x00007fffffffe17c) at util.cc:485
    frame #7: libponyc.tests`IftypeTest_Codegen_True_Test::TestBody(this=0x0000000804c22140) at iftype.cc:202
    frame #8: libponyc.tests`void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(object=0x0000000804c22140, method=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="")(void), char const*) at gtest.cc:2401
    frame #9: libponyc.tests`void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(object=0x0000000804c22140, method=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, location="")(void), char const*) at gtest.cc:2437
    frame #10: libponyc.tests`testing::Test::Run(this=0x0000000804c22140) at gtest.cc:2473
    frame #11: libponyc.tests`testing::TestInfo::Run(this=0x0000000804cf0220) at gtest.cc:2655
    frame #12: libponyc.tests`testing::TestCase::Run(this=0x0000000804cefb20) at gtest.cc:2773
    frame #13: libponyc.tests`testing::internal::UnitTestImpl::RunAllTests(this=0x0000000804c34000) at gtest.cc:4673
    frame #14: libponyc.tests`bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x0000000804c34000, method=50 00 b7 00 00 00 00 00 00 00 00 00 00 00 00 00, location="")(void), char const*) at gtest.cc:2401
    frame #15: libponyc.tests`bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(object=0x0000000804c34000, method=50 00 b7 00 00 00 00 00 00 00 00 00 00 00 00 00, location="")(void), char const*) at gtest.cc:2437
    frame #16: libponyc.tests`testing::UnitTest::Run(this=0x000000000339fe28) at gtest.cc:4281
    frame #17: libponyc.tests`RUN_ALL_TESTS(void) at gtest.h:2237
    frame #18: libponyc.tests`main(argc=1, argv=0x00007fffffffea38) at util.cc:689
    frame #19: 0x00000000007fa4bf libponyc.tests`_start + 383
  thread #3, name = 'libponyc.tests', stop reason = signal SIGSEGV
    frame #0: 0x00000008036f8c7c libthr.so.3`___lldb_unnamed_symbol180$$libthr.so.3 + 92
    frame #1: libponyc.tests`ponyint_thread_join(thread=0x0000000804c9d600) at threads.c:220
    frame #2: libponyc.tests`ponyint_asio_stop at asio.c:68
    frame #3: libponyc.tests`quiescent(sched=0x0000000812086800, tsc=4215260162933, tsc2=4215261197400) at scheduler.c:350
    frame #4: libponyc.tests`steal(sched=0x0000000812086800) at scheduler.c:686
    frame #5: libponyc.tests`run(sched=0x0000000812086800) at scheduler.c:869
    frame #6: libponyc.tests`run_thread(arg=0x0000000812086800) at scheduler.c:934
    frame #7: 0x00000008036eabc5 libthr.so.3`___lldb_unnamed_symbol1$$libthr.so.3 + 325
  thread #4, name = 'libponyc.tests', stop reason = signal SIGSEGV
    frame #0: 0x0000000804514788 libc.so.7`_sigwait + 8
    frame #1: 0x00000008036f0751 libthr.so.3`___lldb_unnamed_symbol98$$libthr.so.3 + 97
    frame #2: libponyc.tests`ponyint_thread_suspend(signal=31) at threads.c:265
    frame #3: libponyc.tests`suspend_scheduler(sched=0x00000008120869c0, current_active_scheduler_count=2) at scheduler.c:521
    frame #4: libponyc.tests`perhaps_suspend_scheduler(sched=0x00000008120869c0, current_active_scheduler_count=2, block_sent=0x00007fff3fff8f1f, steal_attempts=0x00007fff3fff8f18, sched_is_blocked=true) at scheduler.c:619
    frame #5: libponyc.tests`steal(sched=0x00000008120869c0) at scheduler.c:746
    frame #6: libponyc.tests`run(sched=0x00000008120869c0) at scheduler.c:869
    frame #7: libponyc.tests`run_thread(arg=0x00000008120869c0) at scheduler.c:934
    frame #8: 0x00000008036eabc5 libthr.so.3`___lldb_unnamed_symbol1$$libthr.so.3 + 325

@slfritchie
Copy link
Contributor Author

Also, I've got some valgrind output at https://gist.github.com/slfritchie/58427fa40958bde5c1d37f65dd09ce0c, if it's useful. The most common problem is:

==9925== Conditional jump or move depends on uninitialised value(s)
==9925==    at 0x22720FB: llvm::AttributeSet::get(llvm::LLVMContext&, llvm::ArrayRef<std::__1::pair<unsigned int, llvm::Attribute> >) (in /usr/home/vagrant/ponyc/build/debug/libp
onyc.tests)
==9925==    by 0x2273983: llvm::AttributeSet::addAttribute(llvm::LLVMContext&, llvm::ArrayRef<unsigned int>, llvm::Attribute) const (in /usr/home/vagrant/ponyc/build/debug/libpon
yc.tests)
==9925==    by 0x22F2E06: llvm::Function::addAttribute(unsigned int, llvm::Attribute) (in /usr/home/vagrant/ponyc/build/debug/libponyc.tests)
==9925==    by 0xBD61CF: init_runtime (codegen.c:290)
==9925==    by 0xBD759A: codegen_gen_test (codegen.c:894)
==9925==    by 0xAF0E5F: PassTest::build_package(char const*, char const*, char const*, bool, char const**, bool) (util.cc:536)
==9925==    by 0xAF0593: PassTest::test_compile(char const*, char const*) (util.cc:335)
==9925==    by 0x8D6A2D: IftypeTest_ThenClause_TypeConstraint_Test::TestBody() (iftype.cc:34)
==9925==    by 0xBB9939: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /usr/home
/vagrant/ponyc/build/debug/libponyc.tests)
==9925==    by 0xB99CE6: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (gtest.cc:2437)
==9925==    by 0xB561CA: testing::Test::Run() (gtest.cc:2473)
==9925==    by 0xB586EA: testing::TestInfo::Run() (gtest.cc:2655)

@SeanTAllen
Copy link
Member

We no longer support FreeBSD 11 so I'm closing this. FreeBSD 12 passes all CI tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants