Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Segfault in pass 'X86 Assembly Printer' #35850

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR36877
Status NEW
Importance P enhancement
Reported by Abigail (abigail.buccaneer@gmail.com)
Reported on 2018-03-23 06:19:38 -0700
Last modified on 2018-03-23 06:22:51 -0700
Version trunk
Hardware PC Linux
CC llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments H5detect-58ab31.sh (4336 bytes, application/x-shellscript)
Blocks
Blocked by
See also
The following segfault was just observed with clang-7, installed via apt from
the official https://apt.llvm.org/ sources. The version is:
1:7~svn328068-1~exp1+0~20180321023840.310~1.gbp0de64b

The output is:

#0 0x00007f04edf3675a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0x85c75a)
#1 0x00007f04edf349d6 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-
7/bin/../lib/libLLVM-7.so.1+0x85a9d6)
#2 0x00007f04edf34b0b (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0x85ab0b)
#3 0x00007f04f1245150 __restore_rt (/lib/x86_64-linux-
gnu/libpthread.so.0+0x13150)
#4 0x00007f04ee5b70db (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xedd0db)
#5 0x00007f04ee5b7574 (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xedd574)
#6 0x00007f04ee5b8e5b llvm::DbgVariable::getFrameIndexExprs() const
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xedee5b)
#7 0x00007f04ee5ac209
llvm::DwarfCompileUnit::constructVariableDIEImpl(llvm::DbgVariable const&,
bool) (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xed2209)
#8 0x00007f04ee5ac6fc
llvm::DwarfCompileUnit::constructVariableDIE(llvm::DbgVariable&, bool)
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xed26fc)
#9 0x00007f04ee5ac723
llvm::DwarfCompileUnit::constructVariableDIE(llvm::DbgVariable&,
llvm::LexicalScope const&, llvm::DIE*&) (/usr/lib/llvm-7/bin/../lib/libLLVM-
7.so.1+0xed2723)
#10 0x00007f04ee5b17d2
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) (/usr/lib/llvm-7/bin/../lib/libLLVM-
7.so.1+0xed77d2)
#11 0x00007f04ee5b4cd8
llvm::DwarfCompileUnit::constructScopeDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&) (/usr/lib/llvm-7/bin/../lib/libLLVM-
7.so.1+0xedacd8)
#12 0x00007f04ee5b1842
llvm::DwarfCompileUnit::createScopeChildrenDIE(llvm::LexicalScope*,
llvm::SmallVectorImpl<llvm::DIE*>&, bool*) (/usr/lib/llvm-7/bin/../lib/libLLVM-
7.so.1+0xed7842)
#13 0x00007f04ee5b4e6f
llvm::DwarfCompileUnit::createAndAddScopeChildren(llvm::LexicalScope*,
llvm::DIE&) (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xedae6f)
#14 0x00007f04ee5b4f1e
llvm::DwarfCompileUnit::constructSubprogramScopeDIE(llvm::DISubprogram const*,
llvm::LexicalScope*) (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xedaf1e)
#15 0x00007f04ee5c7be1 llvm::DwarfDebug::endFunctionImpl(llvm::MachineFunction
const*) (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xeedbe1)
#16 0x00007f04ee59e014
llvm::DebugHandlerBase::endFunction(llvm::MachineFunction const*)
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0xec4014)
#17 0x00007f04ee58e607 llvm::AsmPrinter::EmitFunctionBody() (/usr/lib/llvm-
7/bin/../lib/libLLVM-7.so.1+0xeb4607)
#18 0x00007f04efacdc2b (/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0x23f3c2b)
#19 0x00007f04ee1ea2b0
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/usr/lib/llvm-
7/bin/../lib/libLLVM-7.so.1+0xb102b0)
#20 0x00007f04ee0154f8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0x93b4f8)
#21 0x00007f04ee015543 llvm::FPPassManager::runOnModule(llvm::Module&)
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0x93b543)
#22 0x00007f04ee014d8f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/usr/lib/llvm-7/bin/../lib/libLLVM-7.so.1+0x93ad8f)
#23 0x0000556a1d6003c2 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> >) (/usr/lib/llvm-
7/bin/clang+0x4ce3c2)
#24 0x0000556a1dbd1cf4 (/usr/lib/llvm-7/bin/clang+0xa9fcf4)
#25 0x0000556a1e24f539 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-
7/bin/clang+0x111d539)
#26 0x0000556a1dbd0e77 clang::CodeGenAction::ExecuteAction() (/usr/lib/llvm-
7/bin/clang+0xa9ee77)
#27 0x0000556a1da08806 clang::FrontendAction::Execute() (/usr/lib/llvm-
7/bin/clang+0x8d6806)
#28 0x0000556a1d9d15ac
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-
7/bin/clang+0x89f5ac)
#29 0x0000556a1dab4a8b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-
7/bin/clang+0x982a8b)
#30 0x0000556a1d5a5c58 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-7/bin/clang+0x473c58)
#31 0x0000556a1d5937de main (/usr/lib/llvm-7/bin/clang+0x4617de)
#32 0x00007f04ec7f41c1 __libc_start_main /build/glibc-itYbWN/glibc-
2.26/csu/../csu/libc-start.c:342:0
#33 0x0000556a1d5a348a _start (/usr/lib/llvm-7/bin/clang+0x47148a)
Stack dump:
0.  Program arguments: /usr/lib/llvm-7/bin/clang -cc1 -triple x86_64-pc-linux-
gnu -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-
file-name H5detect.c -mrelocation-model pic -pic-level 2 -mthread-model posix -
fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-
array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-
version=4 -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file
/home/abigail/code/fluency/build/posix/x86_64/debug/hdf5/hdf5-
1.8.16/H5detect.gcno -resource-dir /usr/lib/llvm-7/lib/clang/7.0.0 -isystem
third-party/gmock-1.7.0/include -isystem third-party/gmock-1.7.0/gtest/include -
isystem third-party/tclap-1.2.0/include -isystem third-party/boost-1.49 -
isystem third-party/jsoncpp-0.6.0-rc2/include -isystem third-party/protobuf-
3.5.0/src -isystem build -isystem build/posix/x86_64/debug/hdf5/hdf5-1.8.16 -D
__STDC_WANT_LIB_EXT1__ -D __STDC_WANT_SECURE_LIB__ -D FLUENCY_HAS_DL -D
_PTHREADS -D __POSIX__ -D _DEBUG -D FLUENCY_EXPORT_TIMING -D
_LARGEFILE64_SOURCE -D _GNU_SOURCE -I src/fluency/platform/pthread -I
src/fluency/platform/posix -I src/fluency/platform -internal-isystem
/usr/local/include -internal-isystem /usr/lib/llvm-7/lib/clang/7.0.0/include -
internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-
isystem /include -internal-externc-isystem /usr/include -Og -Wall -Wextra -Wno-
unknown-pragmas -Wno-unused-parameter -Wno-ignored-attributes -Wdocumentation -
Wmissing-noreturn -Wno-error=missing-noreturn -w -fdebug-compilation-dir
/home/abigail/code/fluency -ferror-limit 19 -fmessage-length 0 -fvisibility
hidden -pthread -stack-protector 1 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o build/posix/x86_64/debug/hdf5/hdf5-1.8.16/H5detect.o -x
c build/posix/x86_64/debug/hdf5/hdf5-1.8.16/H5detect.c
1.  <eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module
'build/posix/x86_64/debug/hdf5/hdf5-1.8.16/H5detect.c'.
4.  Running pass 'X86 Assembly Printer' on function '@detect_C99_floats'
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 7.0.0- (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: 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: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/H5detect-58ab31.c
clang: note: diagnostic msg: /tmp/H5detect-58ab31.sh
clang: note: diagnostic msg:

********************
Quuxplusone commented 6 years ago

Attached H5detect-58ab31.sh (4336 bytes, application/x-shellscript): Associated run script

Quuxplusone commented 6 years ago

The preprocessed source is too large to fit here; it's available at https://gist.githubusercontent.com/AbigailBuccaneer/d98086edd63de9bdda42c62ef6e47344/raw/49dda4d62c0a5a00f7e612c331f16b76696300bc/tmp__H5detect-58ab31.c