<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - segfault when compiling with unusal parameters"
href="https://bugs.llvm.org/show_bug.cgi?id=50188">50188</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>segfault when compiling with unusal parameters
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tobias.kaes@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=24817" name="attach_24817" title="files referenced by crash log">attachment 24817</a> <a href="attachment.cgi?id=24817&action=edit" title="files referenced by crash log">[details]</a></span>
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
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> 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:
********************</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>