<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 - [X86][MC] Crash when assembling file containing section with 64-bit alignment"
href="https://bugs.llvm.org/show_bug.cgi?id=34726">34726</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[X86][MC] Crash when assembling file containing section with 64-bit alignment
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>konstantin.belochapka@sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>the clang assembler crashes when passed the attached assembly
file which contains the following lines:
.text
.align 0x100000000, 0x90
mov %rax,%rbx
.data
.align 0x200000000, 0x90
mov %rsi, %rdi
$ clang -c source1.s
clang-6.0: /llvm/include/llvm/Support/MathExtras.h:678: uint64_t
llvm::alignTo(uint64_t, uint64_t, uint64_t): Assertion `Align != 0u && "Align
can't be 0."' failed.
#0 0x0000000003bbf9bf llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/llvm/lib/Support/Unix/Signals.inc:398:0
#1 0x0000000003bbfa52 PrintStackTraceSignalHandler(void*)
/llvm/lib/Support/Unix/Signals.inc:462:0
#2 0x0000000003bbdc2d llvm::sys::RunSignalHandlers()
/llvm/lib/Support/Signals.cpp:49:0
#3 0x0000000003bbf22b SignalHandler(int)
/llvm/lib/Support/Unix/Signals.inc:252:0
#4 0x00007f3073987390 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#5 0x00007f30726f2428 gsignal
/build/glibc-bfm8X4/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0
#6 0x00007f30726f402a abort /build/glibc-bfm8X4/glibc-2.23/stdlib/abort.c:91:0
#7 0x00007f30726eabd7 __assert_fail_base
/build/glibc-bfm8X4/glibc-2.23/assert/assert.c:92:0
#8 0x00007f30726eac82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#9 0x0000000001ae5441 llvm::alignTo(unsigned long, unsigned long, unsigned
long) /llvm/include/llvm/Support/MathExtras.h:679:0
#10 0x00000000020d4e07 llvm::OffsetToAlignment(unsigned long, unsigned long)
/llvm/include/llvm/Support/MathExtras.h:720:0
#11 0x0000000003782555 llvm::MCAssembler::computeFragmentSize(llvm::MCAsmLayout
const&, llvm::MCFragment const&) const
/data/projects/BUGS/38096/llvm/lib/MC/MCAssembler.cpp:292:0
#12 0x0000000003782bad llvm::MCAsmLayout::layoutFragment(llvm::MCFragment*)
/llvm/lib/MC/MCAssembler.cpp:362:0
#13 0x00000000037bc5bc llvm::MCAsmLayout::ensureValid(llvm::MCFragment const*)
const /llvm/lib/MC/MCFragment.cpp:73:0
#14 0x00000000037bc607 llvm::MCAsmLayout::getFragmentOffset(llvm::MCFragment
const*) const /llvm/lib/MC/MCFragment.cpp:79:0
#15 0x00000000037859bd llvm::MCAssembler::finishLayout(llvm::MCAsmLayout&)
/llvm/lib/MC/MCAssembler.cpp:955:0
#16 0x0000000003784411 llvm::MCAssembler::layout(llvm::MCAsmLayout&)
/llvm/lib/MC/MCAssembler.cpp:704:0
#17 0x00000000037849d1 llvm::MCAssembler::Finish()
/llvm/lib/MC/MCAssembler.cpp:755:0
#18 0x00000000037d0f54 llvm::MCObjectStreamer::FinishImpl()
/llvm/lib/MC/MCObjectStreamer.cpp:608:0
#19 0x00000000037b3bcd llvm::MCELFStreamer::FinishImpl()
/llvm/lib/MC/MCELFStreamer.cpp:621:0
#20 0x00000000037d9aac llvm::MCStreamer::Finish()
/llvm/lib/MC/MCStreamer.cpp:748:0
#21 0x0000000003805208 (anonymous namespace)::AsmParser::Run(bool, bool)
/llvm/lib/MC/MCParser/AsmParser.cpp:961:0
#22 0x0000000001ac966f ExecuteAssembler((anonymous
namespace)::AssemblerInvocation&, clang::DiagnosticsEngine&)
/llvm/tools/clang/tools/driver/cc1as_main.cpp:453:0
#23 0x0000000001ac9e28 cc1as_main(llvm::ArrayRef<char const*>, char const*,
void*) /llvm/tools/clang/tools/driver/cc1as_main.cpp:534:0
#24 0x0000000001ab5346 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef) /llvm/tools/clang/tools/driver/driver.cpp:304:0
#25 0x0000000001ab5ec1 main /llvm/tools/clang/tools/driver/driver.cpp:381:0
#26 0x00007f30726dd830 __libc_start_main
/build/glibc-bfm8X4/glibc-2.23/csu/../csu/libc-start.c:325:0
#27 0x0000000001ab2939 _start (/llvm-build/r313400/bin/clang-6.0+0x1ab2939)
Stack dump:
0. Program arguments: /llvm-build/r313400/bin/clang-6.0 -cc1as -triple
x86_64-unknown-linux-gnu -filetype obj -main-file-name source1.s -target-cpu
x86-64 -fdebug-compilation-dir /70046 -dwarf-debug-producer clang version 6.0.0
(trunk 313400) -dwarf-version=4 -mrelocation-model static -o source1.o
source1.s
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang integrated assembler command failed due to signal (use
-v to see invocation)
clang version 6.0.0 (trunk 313400)
This is reproducible on all clang versions.</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>