[llvm-bugs] [Bug 50188] New: segfault when compiling with unusal parameters

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 30 13:18:57 PDT 2021


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

            Bug ID: 50188
           Summary: segfault when compiling with unusal parameters
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tobias.kaes at gmx.de
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

Created attachment 24817
  --> https://bugs.llvm.org/attachment.cgi?id=24817&action=edit
files referenced by crash log

I've been trying various parameters to compile "raw" x86_64 assembly and tried
unusual combinations when I encountered this error. The console asked me to
report it so I'm doing that.

~/test$ clang -nostdinc -nostdlib -ffreestanding -fuse-ld=lld
--target=x86_64-pc-windows-eabi -v test.cpp
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-windows-eabi
Thread model: posix
InstalledDir: /usr/bin
 "/usr/lib/llvm-10/bin/clang" -cc1 -triple x86_64-pc-windows-eabi -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model
posix -mframe-pointer=none -fmath-errno -fno-rounding-math -masm-verbose
-mconstructor-aliases -ffreestanding -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -v -nostdsysteminc -nobuiltininc -resource-dir
/usr/lib/llvm-10/lib/clang/10.0.0 -fdeprecated-macro -fdebug-compilation-dir
/home/zarat/test -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit
-fgnuc-version=4.2.1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /tmp/test-a8fb80.o
-x c++ test.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target
x86_64-pc-linux-gnu
#include "..." search starts here:
End of search list.
Stack dump:
0.      Program arguments: /usr/lib/llvm-10/bin/clang -cc1 -triple
x86_64-pc-windows-eabi -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name test.cpp
-mrelocation-model pic -pic-level 2 -mthread-model posix -mframe-pointer=none
-fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases
-ffreestanding -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v
-nostdsysteminc -nobuiltininc -resource-dir /usr/lib/llvm-10/lib/clang/10.0.0
-fdeprecated-macro -fdebug-compilation-dir /home/zarat/test -ferror-limit 19
-fmessage-length 0 -fno-use-cxa-atexit -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o /tmp/test-a8fb80.o -x c++ test.cpp
1.      <eof> parser at end of file
2.      Code generation
 #0 0x00007f996c51e4ff llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x9814ff)
 #1 0x00007f996c51c7b0 llvm::sys::RunSignalHandlers()
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x97f7b0)
 #2 0x00007f996c51eac5 (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x981ac5)
 #3 0x00007f9972cee420 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x15420)
 #4 0x00007f996d4bb036 (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x191e036)
 #5 0x00007f996d4b7dec (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x191adec)
 #6 0x00007f996d46c3af llvm::MCAssembler::layout(llvm::MCAsmLayout&)
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x18cf3af)
 #7 0x00007f996d46c798 llvm::MCAssembler::Finish()
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x18cf798)
 #8 0x00007f996cb5a4b7 llvm::AsmPrinter::doFinalization(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0xfbd4b7)
 #9 0x00007f996c6240b1 llvm::FPPassManager::doFinalization(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0xa870b1)
#10 0x00007f996c624572 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/lib/x86_64-linux-gnu/libLLVM-10.so.1+0xa87572)
#11 0x00007f9971619433 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> >)
(/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x13e8433)
#12 0x00007f9971898e1c (/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1667e1c)
#13 0x00007f9970a86c13 clang::ParseAST(clang::Sema&, bool, bool)
(/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x855c13)
#14 0x00007f9971efce58 clang::FrontendAction::Execute()
(/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1ccbe58)
#15 0x00007f9971eb58a1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1c848a1)
#16 0x00007f9971f60daf
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/lib/x86_64-linux-gnu/libclang-cpp.so.10+0x1d2fdaf)
#17 0x000000000041229d cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/lib/llvm-10/bin/clang+0x41229d)
#18 0x00000000004105b1 (/usr/lib/llvm-10/bin/clang+0x4105b1)
#19 0x000000000041036d main (/usr/lib/llvm-10/bin/clang+0x41036d)
#20 0x00007f996b6850b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#21 0x000000000040d7ce _start (/usr/lib/llvm-10/bin/clang+0x40d7ce)
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-windows-eabi
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/test-d897b2.cpp
clang: note: diagnostic msg: /tmp/test-d897b2.sh
clang: 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/20210430/9078a56e/attachment.html>


More information about the llvm-bugs mailing list