[llvm-bugs] [Bug 44920] New: [WebAssembly] Crash when building bullet with DWARF

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 14 17:56:52 PST 2020


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

            Bug ID: 44920
           Summary: [WebAssembly] Crash when building bullet with DWARF
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: alonzakai at gmail.com
                CC: llvm-bugs at lists.llvm.org

I tried to reduce this to a single file, but it's sensitive to that somehow -
apologies for not having a smaller testcase.

STR:

1. Get emscripten, https://github.com/emscripten-core/emscripten
2. In the root dir of emscripten, run

clang -target wasm32-unknown-emscripten -D__EMSCRIPTEN_major__=1
-D__EMSCRIPTEN_minor__=39 -D__EMSCRIPTEN_tiny__=8 -D_LIBCPP_ABI_VERSION=2
-Dunix -D__unix -D__unix__ -Werror=implicit-function-declaration -Xclang
-nostdsysteminc -Xclang -isystem`pwd`/system/include/libcxx -Xclang
-isystem`pwd`/system/lib/libcxxabi/include -Xclang
-isystem`pwd`/system/include/compat -Xclang -isystem`pwd`/system/include
-Xclang -isystem`pwd`/system/include/libc -Xclang
-isystem`pwd`/system/lib/libc/musl/arch/emscripten -Xclang
-isystem`pwd`/system/local/include -DHAVE_CONFIG_H -I. -I.. -O2 -Werror -O3
-Wno-dynamic-class-memaccess -Wno-format -Wno-format-extra-args
-Wno-format-security -Wno-pointer-bool-conversion -Wno-unused-volatile-lvalue
-Wno-c++11-compat-deprecated-writable-strings -Wno-invalid-pp-token
-Wno-shift-negative-value -c -Werror -O3 -Wno-dynamic-class-memaccess
-Wno-format -Wno-format-extra-args -Wno-format-security
-Wno-pointer-bool-conversion -Wno-unused-volatile-lvalue
-Wno-c++11-compat-deprecated-writable-strings -Wno-invalid-pp-token
-Wno-shift-negative-value -std=c++03 -DEMSCRIPTEN
tests/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp -Xclang
-isystem`pwd`/system/include/SDL -c -mllvm
-combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm
-disable-lsr -Itests/bullet/src -g

It will not crash without the -g at the end, but does crash with it:

1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module
'tests/bullet/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp'.
4.      Running pass 'WebAssembly Assembly Printer' on function
'@_ZNK14btCapsuleShape21calculateLocalInertiaEfR9btVector3'
 #0 0x00007fd7dbe6bb24 PrintStackTraceSignalHandler(void*)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x73eb24)
 #1 0x00007fd7dbe6969e llvm::sys::RunSignalHandlers()
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x73c69e)
 #2 0x00007fd7dbe6ac94 llvm::sys::CleanupOnSignal(unsigned long)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x73dc94)
 #3 0x00007fd7dbda4903 CrashRecoverySignalHandler(int)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x677903)
 #4 0x00007fd7db6ef520 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x13520)
 #5 0x00007fd7d7cbc081 raise
/build/glibc-G5rUEF/glibc-2.29/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007fd7d7ca7535 abort /build/glibc-G5rUEF/glibc-2.29/stdlib/abort.c:81:7
 #7 0x00007fd7d7ca740f _nl_load_domain
/build/glibc-G5rUEF/glibc-2.29/intl/loadmsgcat.c:1177:9
 #8 0x00007fd7d7cb4b92 (/lib/x86_64-linux-gnu/libc.so.6+0x32b92)
 #9 0x00007fd7dd9d4d33
llvm::WebAssemblyFrameLowering::getDwarfFrameBase(llvm::MachineFunction const&)
const (/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x22a7d33)
#10 0x00007fd7dc6d59ed
llvm::DwarfCompileUnit::updateSubprogramScopeDIE(llvm::DISubprogram const*)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0xfa89ed)
#11 0x00007fd7dc6d902c
llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*,
llvm::LexicalScope*) (/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0xfac02c)
#12 0x00007fd7dc6ebf02 llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction
const*) (/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0xfbef02)
#13 0x00007fd7dc6cb2e0
llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0xf9e2e0)
#14 0x00007fd7dc6b3d9b llvm::AsmPrinter::EmitFunctionBody()
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0xf86d9b)
#15 0x00007fd7dd9ad534
llvm::WebAssemblyAsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x2280534)
#16 0x00007fd7dc1e7cce
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0xabacce)
#17 0x00007fd7dbfc8fb1 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x89bfb1)
#18 0x00007fd7dbfc92b8 llvm::FPPassManager::runOnModule(llvm::Module&)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x89c2b8)
#19 0x00007fd7dbfc99f0 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x89c9f0)
#20 0x00007fd7d983a182 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x16be182)
#21 0x00007fd7d9b3db3c
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x19c1b3c)
#22 0x00007fd7d8947993 clang::ParseAST(clang::Sema&, bool, bool)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x7cb993)
#23 0x00007fd7da38c3c0 clang::FrontendAction::Execute()
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x22103c0)
#24 0x00007fd7da327a63
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x21aba63)
#25 0x00007fd7da400280
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x2284280)
#26 0x00000000004109a6 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/Dev/sdk/upstream/bin/clang+0x4109a6)
#27 0x000000000040eefc ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/Dev/sdk/upstream/bin/clang+0x40eefc)
#28 0x00007fd7d9fcfaa2 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const::$_1>(long)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x1e53aa2)
#29 0x00007fd7dbda4791
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/Dev/sdk/upstream/bin/../lib/libLLVM-11git.so+0x677791)
#30 0x00007fd7d9fcf067
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
>, std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >*, bool*) const
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x1e53067)
#31 0x00007fd7d9f9ce5b
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x1e20e5b)
#32 0x00007fd7d9f9d27a
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x1e2127a)
#33 0x00007fd7d9fb6178
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/Dev/sdk/upstream/bin/../lib/libclang-cpp.so.11git+0x1e3a178)
#34 0x000000000040e6b9 main (/Dev/sdk/upstream/bin/clang+0x40e6b9)
#35 0x00007fd7d7ca8bbb __libc_start_main
/build/glibc-G5rUEF/glibc-2.29/csu/../csu/libc-start.c:342:3
#36 0x000000000040bbe9 _start (/Dev/sdk/upstream/bin/clang+0x40bbe9)
clang-11: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 11.0.0
(/b/s/w/ir/cache/git/chromium.googlesource.com-external-github.com-llvm-llvm--project
da3f2b414ace1f24054ae9255f811b653d9cff99)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /Dev/sdk/upstream/bin
clang-11: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-11: note: diagnostic msg: 
********************

-- 
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/20200215/d9250d90/attachment-0001.html>


More information about the llvm-bugs mailing list