<html>
<head>
<base href="https://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 --- - [3.7] segmentation fault on simple C compilation (mingw-w64)"
href="https://llvm.org/bugs/show_bug.cgi?id=24728">24728</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[3.7] segmentation fault on simple C compilation (mingw-w64)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>daniel.f.starke@freenet.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>I am getting a segmentation fault in Clang when trying to compile a simple
hello world C code with clang -o hello.exe hello.c
testcase:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
printf("Hello World!\n");
return EXIT_SUCCESS;
}
Backtrace:
Starting program: E:\msys\mingw64-64\bin\clang.exe -o hello.exe hello.c
[New Thread 5112.0xb8c]
Program received signal SIGSEGV, Segmentation fault.
llvm::opt::ArgList::MakeArgString (this=0x30ad70, Str=...) at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/include/llvm/Option/ArgList.h:298
298 return MakeArgStringRef(Str.toStringRef(Buf));
#0 llvm::opt::ArgList::MakeArgString (this=0x30ad70, Str=...)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/include/llvm/Option/ArgList.h:298
#1 0x00000000004eb13b in clang::driver::tools::Clang::AddObjCRuntimeArgs
(this=this@entry=0x30c150, args=..., cmdArgs=...,
rewriteKind=rewriteKind@entry=clang::driver::tools::Clang::RK_None)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/lib/Driver/Tools.cpp:5143
#2 0x000000000050d2f6 in clang::driver::tools::Clang::ConstructJob
(this=<optimized out>, this@entry=0x30c150, C=..., JA=..., Output=...,
Inputs=..., Args=..., LinkingOutput=LinkingOutput@entry=0x0)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/lib/Driver/Tools.cpp:4509
#3 0x00000000004b657e in clang::driver::Driver::BuildJobsForAction
(this=this@entry=0x22eda0, C=..., A=<optimized out>, TC=TC@entry=0x30b2d0,
BoundArch=BoundArch@entry=0x0, AtTopLevel=false,
MultipleArchs=MultipleArchs@entry=false, LinkingOutput=LinkingOutput@entry=0x0,
Result=...)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/lib/Driver/Driver.cpp:1858
#4 0x00000000004b645f in clang::driver::Driver::BuildJobsForAction
(this=this@entry=0x22eda0, C=..., A=<optimized out>, A@entry=0x30c0d0,
TC=0x30b2d0, BoundArch=BoundArch@entry=0x0,
AtTopLevel=AtTopLevel@entry=true, MultipleArchs=false, LinkingOutput=0x0,
Result=...)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/lib/Driver/Driver.cpp:1823
#5 0x00000000004b6de2 in clang::driver::Driver::BuildJobs (this=<optimized
out>, C=...)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/lib/Driver/Driver.cpp:1625
#6 0x00000000004b8180 in clang::driver::Driver::BuildCompilation
(this=this@entry=0x22eda0, ArgList=...)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/lib/Driver/Driver.cpp:476
#7 0x0000000002548308 in main (argc_=<optimized out>, argv_=<optimized out>)
at
e:/Downloads/Applications/llvm/3.7/llvm-3.7.0.src/tools/clang/tools/driver/driver.cpp:457
Clang/LLVM was compiled as 64-bit debug+assert build with:
../llvm-3.7.0.src/configure --prefix=/mingw64-64 --host=x86_64-w64-mingw32
--disable-shared --enable-assertions --enable-debug-symbols
--enable-keep-symbols --enable-targets="x86 x86_64 cpp" --disable-docs
"--with-gcc-toolchain=`which x86_64-w64-mingw32-gcc | xargs dirname`"
CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++
AR=x86_64-w64-mingw32-gcc-ar LD=x86_64-w64-mingw32-ld "CPPFLAGS=-std=c++14"
using gcc 5.2.0:
../../src/gcc-5.2.0/configure --host=x86_64-w64-mingw32
--enable-languages=c,c++ --enable-seh-exceptions --enable-threads=posix
--disable-nls --disable-shared --enable-static --enable-fully-dynamic-string
--enable-lto --enable-plugins --enable-libgomp --with-dwarf2
--disable-win32-registry --enable-version-specific-runtime-libs
--prefix=/mingw64-64 --with-sysroot=/mingw64-64 --target=x86_64-w64-mingw32
--enable-targets=all --enable-checking=release
--with-gmp=/usr/new-gcc/lib/gmp-5.0.5 --with-mpfr=/usr/new-gcc/lib/mpfr-2.4.2
--with-mpc=/usr/new-gcc/lib/mpc-0.9 --with-isl=/usr/new-gcc/lib/isl-0.12.2
--with-cloog=/usr/new-gcc/lib/cloog-0.18.3 --with-host-libstdcxx='-lstdc++
-lsupc++' --disable-cloog-version-check --enable-cloog-backend=isl</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>