<html>
<head>
<base href="http://llvm.org/bugs/" />
</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 --- - puts segfault under lli but not llc"
href="http://llvm.org/bugs/show_bug.cgi?id=22722">22722</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>puts segfault under lli but not llc
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.5
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>buck.2019@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>my hello-world program works fine under llc, but segfaults under lli. is there
any reason for that?
<a href="http://paste.pound-python.org/show/fXhE19RSX0AqMW2W5hc8/">http://paste.pound-python.org/show/fXhE19RSX0AqMW2W5hc8/</a>
$ cat hello.ll
; ModuleID = ""
target triple = ""
target datalayout = ""
@".str4" = global [13 x i8] c"hello\2c\20world\21"
declare i32 @"puts"(i8* %".1")
define i32 @"main"()
{
.1:
%".2" = call i32 (i8*)* @"puts"(i8* getelementptr ([13 x i8]* @".str4", i32
0, i32 0))
ret i32 0
}
$ make
python hello.py > hello.ll
llc hello.ll
clang hello.s -o hello
./hello
hello, world!
$ cat hello.ll | lli
0 libLLVM-3.5.dylib 0x0000000104f2dd70
llvm::sys::PrintStackTrace(__sFILE*) + 40
1 libLLVM-3.5.dylib 0x0000000104f2e15b SignalHandler(int) + 248
2 libsystem_platform.dylib 0x00007fff81b345aa _sigtramp + 26
3 libsystem_malloc.dylib 0x00007fff8984727c malloc + 42
4 libsystem_c.dylib 0x00007fff80eeabd0 puts + 53
5 libsystem_c.dylib 0x0000000105e70027 puts + 2230867084
6 libLLVM-3.5.dylib 0x0000000104989b6f
llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*,
std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char
const* const*) + 1609
7 lli 0x000000010439707d
8 libdyld.dylib 0x00007fff8bbe75fd start + 1
9 libdyld.dylib 0x0000000000000001 start + 1950452229
Stack dump:
0. Program arguments: lli
Segmentation fault: 11
$ llc --version
LLVM (<a href="http://llvm.org/">http://llvm.org/</a>):
LLVM version 3.5.1
Optimized build with assertions.
Built Feb 26 2015 (15:28:00).
Default target: x86_64-apple-darwin13.4.0
Host CPU: core-avx2
Registered Targets:
aarch64 - AArch64 (little endian)
aarch64_be - AArch64 (big endian)
arm - ARM
arm64 - AArch64 (little endian)
arm64_be - AArch64 (big endian)
armeb - ARM (big endian)
cpp - C++ backend
hexagon - Hexagon
mips - Mips
mips64 - Mips64 [experimental]
mips64el - Mips64el [experimental]
mipsel - Mipsel
msp430 - MSP430 [experimental]
nvptx - NVIDIA PTX 32-bit
nvptx64 - NVIDIA PTX 64-bit
ppc32 - PowerPC 32
ppc64 - PowerPC 64
ppc64le - PowerPC 64 LE
r600 - AMD GPUs HD2XXX-HD6XXX
sparc - Sparc
sparcv9 - Sparc V9
systemz - SystemZ
thumb - Thumb
thumbeb - Thumb (big endian)
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
xcore - XCore
$ lli --version
LLVM (<a href="http://llvm.org/">http://llvm.org/</a>):
LLVM version 3.5.1
Optimized build with assertions.
Built Feb 26 2015 (15:28:00).
Default target: x86_64-apple-darwin13.4.0
Host CPU: core-avx2</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>