[llvm-bugs] [Bug 24728] New: [3.7] segmentation fault on simple C compilation (mingw-w64)

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Sep 6 02:58:30 PDT 2015


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

            Bug ID: 24728
           Summary: [3.7] segmentation fault on simple C compilation
                    (mingw-w64)
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: daniel.f.starke at freenet.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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 at entry=0x30c150, args=..., cmdArgs=..., 
    rewriteKind=rewriteKind at 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 at entry=0x30c150, C=..., JA=..., Output=..., 
    Inputs=..., Args=..., LinkingOutput=LinkingOutput at 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 at entry=0x22eda0, C=..., A=<optimized out>, TC=TC at entry=0x30b2d0, 
    BoundArch=BoundArch at entry=0x0, AtTopLevel=false,
MultipleArchs=MultipleArchs at entry=false, LinkingOutput=LinkingOutput at 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 at entry=0x22eda0, C=..., A=<optimized out>, A at entry=0x30c0d0, 
    TC=0x30b2d0, BoundArch=BoundArch at entry=0x0,
AtTopLevel=AtTopLevel at 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 at 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

-- 
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/20150906/bdeca369/attachment-0001.html>


More information about the llvm-bugs mailing list