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

Cannot install sqlite3 gem on MacOS #2729

Closed
gogainda opened this issue Sep 11, 2022 · 12 comments
Closed

Cannot install sqlite3 gem on MacOS #2729

gogainda opened this issue Sep 11, 2022 · 12 comments

Comments

@gogainda
Copy link
Contributor

How to reproduce

gem install sqlite3

Output

https://gist.github.com/gogainda/62387374b09d4c9dae16b86f9c3a7531

@flavorjones
Copy link
Contributor

The CI pipeline exercises this code now, see: sparklemotion/sqlite3-ruby#347

I'm able to reproduce what you're seeing when I use the packaged sqlite library: https://github.com/sparklemotion/sqlite3-ruby/runs/8293766707?check_suite_focus=true

A workaround you may wish to consider is to use system libraries, so something like:

gem install sqlite3 -- --enable-system-libraries --with-opt-dir=$(brew --prefix sqlite3)

I would be interested in working with the TR team to understand the root cause.

@nirvdrum
Copy link
Collaborator

I'm sorry no one has looked at this yet. Much of the team is either on holiday or at a conference this week. It may be another week yet before someone is able to investigate.

@eregon eregon added the macos label Sep 30, 2022
@eregon
Copy link
Member

eregon commented Sep 30, 2022

This seems a segfault of clang-14 dsymutil: (copying from the end of the gist)

...
warning: Unsupported attribute form DW_FORM_loclistx in cloneAttribute. Dropping.
note: while processing /var/folders/x7/dn5x_jdx13q969_jl0bjm_zxmxpmqn/T/cc-259a82.o
warning: Unsupported attribute form DW_FORM_loclistx in cloneAttribute. Dropping.
note: while processing /var/folders/x7/dn5x_jdx13q969_jl0bjm_zxmxpmqn/T/cc-259a82.o
warning: Unsupported attribute form DW_FORM_loclistx in cloneAttribute. Dropping.
note: while processing /var/folders/x7/dn5x_jdx13q969_jl0bjm_zxmxpmqn/T/cc-259a82.o
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.dylib            0x000000011210a51b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  libLLVM.dylib            0x0000000112109258 llvm::sys::RunSignalHandlers() + 248
2  libLLVM.dylib            0x000000011210ab97 SignalHandler(int) + 295
3  libsystem_platform.dylib 0x00007ff8091c3dfd _sigtramp + 29
4  libLLVM.dylib            0x00000001120eabd7 llvm::raw_fd_ostream::write_impl(char const*, unsigned long) + 71
5  libLLVM.dylib            0x0000000112c358c6 llvm::DWARFLinker::DIECloner::cloneBlockAttribute(llvm::DIE&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::DWARFAbbreviationDeclaration::AttributeSpec, llvm::DWARFFormValue const&, unsigned int, bool) + 1190
6  libLLVM.dylib            0x0000000112c36051 llvm::DWARFLinker::DIECloner::cloneAttribute(llvm::DIE&, llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, llvm::DWARFFormValue const&, llvm::DWARFAbbreviationDeclaration::AttributeSpec, unsigned int, llvm::DWARFLinker::DIECloner::AttributesInfo&, bool) + 161
7  libLLVM.dylib            0x0000000112c36bda llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 1834
8  libLLVM.dylib            0x0000000112c37386 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3798
9  libLLVM.dylib            0x0000000112c37386 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3798
10 libLLVM.dylib            0x0000000112c37386 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3798
11 libLLVM.dylib            0x0000000112c37386 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3798
12 libLLVM.dylib            0x0000000112c3d202 llvm::DWARFLinker::DIECloner::cloneAllCompileUnits(llvm::DWARFContext&, llvm::DWARFFile const&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, bool) + 498
13 libLLVM.dylib            0x0000000112c40271 llvm::DWARFLinker::link()::$_5::operator()(unsigned long) const + 689
14 libLLVM.dylib            0x0000000112c42634 std::__1::__function::__func<llvm::DWARFLinker::link()::$_8, std::__1::allocator<llvm::DWARFLinker::link()::$_8>, void ()>::operator()() + 68
15 libLLVM.dylib            0x00000001125f9418 std::__1::__function::__func<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'(), std::__1::allocator<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()>, void ()>::operator()() + 24
16 libLLVM.dylib            0x00000001120a6ce3 void* llvm::thread::ThreadProxy<std::__1::tuple<llvm::ThreadPool::grow(int)::$_0> >(void*) + 643
17 libsystem_pthread.dylib  0x00007ff8091ae4e1 _pthread_start + 125
18 libsystem_pthread.dylib  0x00007ff8091a9f6b thread_start + 15
clang-14: error: unable to execute command: Segmentation fault: 11
clang-14: error: dsymutil command failed due to signal (use -v to see invocation)
Process failed: #<Process::Status: pid 3236 exit 254>

@eregon
Copy link
Member

eregon commented Sep 30, 2022

Correction, it's a segfault of dsymutil provided by XCode. That's also explains why it's only on macOS. Maybe updating XCode/CLI tools helps.

@eregon
Copy link
Member

eregon commented Sep 30, 2022

FWIW similar-looking issue which was fixed in 22.2: #2710 (comment)
But this is different since it's on a build more recent than 22.2.

@lewurm lewurm self-assigned this Sep 30, 2022
@eregon
Copy link
Member

eregon commented Sep 30, 2022

Maybe updating XCode/CLI tools helps.

@lewurm tried and it still repros with latest (Xcode14rc1), so need to try that.

@lewurm
Copy link
Member

lewurm commented Oct 3, 2022

Thanks for the bug report.

Unfortunately reverting the behaviour of #2710 (i.e. using the system dsymutil) doesn't help either for this issue.

With a debug build of dsymutil I get the following stack trace:

Assertion failed: (Die >= First && Die < First + DieArray.size()), function getDIEIndex, file DWARFUnit.h, line 248.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVM.dylib            0x000000011c855260 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 72
1  libLLVM.dylib            0x000000011c85577c PrintStackTraceSignalHandler(void*) + 28
2  libLLVM.dylib            0x000000011c853890 llvm::sys::RunSignalHandlers() + 144
3  libLLVM.dylib            0x000000011c8571f4 SignalHandler(int) + 252
4  libsystem_platform.dylib 0x000000018270f4a4 _sigtramp + 56
5  libsystem_pthread.dylib  0x00000001826f7ee0 pthread_kill + 288
6  libsystem_c.dylib        0x0000000182632340 abort + 168
7  libsystem_c.dylib        0x0000000182631754 err + 0
8  libLLVM.dylib            0x000000011e320d60 llvm::DWARFUnit::getDIEIndex(llvm::DWARFDebugInfoEntry const*) + 176
9  libLLVM.dylib            0x000000011e31f4d0 llvm::DWARFUnit::getDIEIndex(llvm::DWARFDie const&) + 48
10 libLLVM.dylib            0x000000011e3277dc llvm::CompileUnit::getInfo(llvm::DWARFDie const&) + 40
11 libLLVM.dylib            0x000000011e32a0f0 llvm::DWARFLinker::DIECloner::cloneExpression(llvm::DataExtractor&, llvm::DWARFExpression, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::SmallVectorImpl<unsigned char>&) + 696
12 libLLVM.dylib            0x000000011e32a6d4 llvm::DWARFLinker::DIECloner::cloneBlockAttribute(llvm::DIE&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::DWARFAbbreviationDeclaration::AttributeSpec, llvm::DWARFFormValue const&, unsigned int, bool) + 744
13 libLLVM.dylib            0x000000011e32b690 llvm::DWARFLinker::DIECloner::cloneAttribute(llvm::DIE&, llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, llvm::DWARFFormValue const&, llvm::DWARFAbbreviationDeclaration::AttributeSpec, unsigned int, llvm::DWARFLinker::DIECloner::AttributesInfo&, bool) + 356
14 libLLVM.dylib            0x000000011e32c508 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 2056
15 libLLVM.dylib            0x000000011e32cb20 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3616
16 libLLVM.dylib            0x000000011e32cb20 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3616
17 libLLVM.dylib            0x000000011e32cb20 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3616
18 libLLVM.dylib            0x000000011e32cb20 llvm::DWARFLinker::DIECloner::cloneDIE(llvm::DWARFDie const&, llvm::DWARFFile const&, llvm::CompileUnit&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, long long, unsigned int, unsigned int, bool, llvm::DIE*) + 3616
19 libLLVM.dylib            0x000000011e332a18 llvm::DWARFLinker::DIECloner::cloneAllCompileUnits(llvm::DWARFContext&, llvm::DWARFFile const&, llvm::StrongType<llvm::NonRelocatableStringpool, llvm::OffsetsTag>&, bool) + 568
20 libLLVM.dylib            0x000000011e335264 llvm::DWARFLinker::link()::$_5::operator()(unsigned long) const + 728
21 libLLVM.dylib            0x000000011e366214 llvm::DWARFLinker::link()::$_8::operator()() const + 196
22 libLLVM.dylib            0x000000011e366144 decltype(static_cast<llvm::DWARFLinker::link()::$_8&>(fp)()) std::__1::__invoke<llvm::DWARFLinker::link()::$_8&>(llvm::DWARFLinker::link()::$_8&) + 24
23 libLLVM.dylib            0x000000011e3660fc void std::__1::__invoke_void_return_wrapper<void, true>::__call<llvm::DWARFLinker::link()::$_8&>(llvm::DWARFLinker::link()::$_8&) + 28
24 libLLVM.dylib            0x000000011e3660d4 std::__1::__function::__alloc_func<llvm::DWARFLinker::link()::$_8, std::__1::allocator<llvm::DWARFLinker::link()::$_8>, void ()>::operator()() + 28
25 libLLVM.dylib            0x000000011e364f70 std::__1::__function::__func<llvm::DWARFLinker::link()::$_8, std::__1::allocator<llvm::DWARFLinker::link()::$_8>, void ()>::operator()() + 28
26 dsymutil                 0x00000001040ae628 std::__1::__function::__value_func<void ()>::operator()() const + 60
27 dsymutil                 0x00000001040ae5e0 std::__1::function<void ()>::operator()() const + 24
28 libLLVM.dylib            0x000000011d539e54 llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()::operator()() const + 32
29 libLLVM.dylib            0x000000011d539e14 decltype(static_cast<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()&>(fp)()) std::__1::__invoke<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()&>(llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()&) + 24
30 libLLVM.dylib            0x000000011d539dcc void std::__1::__invoke_void_return_wrapper<void, true>::__call<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()&>(llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()&) + 28
31 libLLVM.dylib            0x000000011d539da4 std::__1::__function::__alloc_func<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'(), std::__1::allocator<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()>, void ()>::operator()() + 28
32 libLLVM.dylib            0x000000011d538974 std::__1::__function::__func<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'(), std::__1::allocator<llvm::ThreadPool::createTaskAndFuture(std::__1::function<void ()>)::'lambda'()>, void ()>::operator()() + 28
33 dsymutil                 0x00000001040ae628 std::__1::__function::__value_func<void ()>::operator()() const + 60
34 dsymutil                 0x00000001040ae5e0 std::__1::function<void ()>::operator()() const + 24
35 libLLVM.dylib            0x000000011c789c58 llvm::ThreadPool::grow(int)::$_0::operator()() const + 248
36 libLLVM.dylib            0x000000011c789b1c void llvm::thread::Apply<llvm::ThreadPool::grow(int)::$_0>(std::__1::tuple<llvm::ThreadPool::grow(int)::$_0>&, std::__1::integer_sequence<unsigned long>) + 32
37 libLLVM.dylib            0x000000011c789ae8 void llvm::thread::GenericThreadProxy<std::__1::tuple<llvm::ThreadPool::grow(int)::$_0> >(void*) + 56
38 libLLVM.dylib            0x000000011c7897e0 void* llvm::thread::ThreadProxy<std::__1::tuple<llvm::ThreadPool::grow(int)::$_0> >(void*) + 24
39 libsystem_pthread.dylib  0x00000001826f826c _pthread_start + 148
40 libsystem_pthread.dylib  0x00000001826f308c thread_start + 8
clang-14: error: unable to execute command: Abort trap: 6
clang-14: error: dsymutil command failed due to signal (use -v to see invocation)

Note that Die is NULL.

@lewurm
Copy link
Member

lewurm commented Oct 3, 2022

It works with LLVM 15 (we ship 14 currently), so I bisected it down to this LLVM commit: llvm/llvm-project@a17c90d

Until then we can downgrade the targeted DWARF version I think: oracle/graal#5135

@eregon
Copy link
Member

eregon commented Oct 4, 2022

FWIW there is another issue when installing the gem on Linux, that's an upstream issue: sparklemotion/sqlite3-ruby#354

@eregon
Copy link
Member

eregon commented Oct 10, 2022

This is fixed now, in oracle/graal@0e6baa5.

@eregon eregon closed this as completed Oct 10, 2022
@flavorjones
Copy link
Contributor

@eregon The CI job is still failing with truffleruby 23.0.0-dev-33ae0fe4. Is that expected? What version will pass CI?

@eregon
Copy link
Member

eregon commented Oct 11, 2022

@flavorjones Right, that's expected because that version doesn't have oracle/graal@0e6baa5.
The latest build has it, truffleruby commit: 72aa843, which includes the graal update.

Could you rerun the CI job? (sparklemotion/sqlite3-ruby#347)

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

No branches or pull requests

5 participants