clang crashes on windows/mingw

Hi all,

When I try to run clang on windows/mingw it crashes:

$ clang
clang: error: no input files
Stack dump:
0. Program arguments: d:\Programs\llvm-d\bin\clang
003D0183 (0x003D2440 0x003D2440 0x0022FF78 0x004021B3) <unknown module>
00403553 (0x0022F950 0x003D5210 0x003D4F10 0x003D23D4)
004021B3 (0x00000001 0x003D4F10 0x003D3340 0x004B0000)
0040124B (0x00000001 0x00000009 0x0022FFF0 0x7C816FE7)
00401298 (0x00000000 0x00000000 0x7FFDE000 0xC0000005)
7C816FE7 (0x00401280 0x00000000 0x78746341 0x00000020), RegisterWaitForInputIdle()+0073 bytes(s)

$ gdb /d/Programs/llvm-d/bin/clang
(gdb) run
Starting program: d:/Programs/llvm-d/bin/clang
[New thread 20676.0x26c8]
clang: error: no input files

Program received signal SIGSEGV, Segmentation fault.
0x0040e984 in clang::driver::OptTable::~OptTable (this=0x3d4f40) at d:/data/llvm/llvm-svn/tools/clang/lib/Driver/OptTable.cpp:128
128 delete Options[i];
(gdb)

Regards,

Ronald

Hi all,

When I try to run clang on windows/mingw it crashes:

Hi Ronald,

Can you get a backtrace ("bt") from gdb at the failure point?

-Chris

Hi all,
When I try to run clang on windows/mingw it crashes:

Hi Ronald,
Can you get a backtrace ("bt") from gdb at the failure point?
-Chris

Hi Chris,

Sure:

$ gdb /d/Programs/llvm-d/bin/clang
This GDB was configured as "i686-pc-mingw32"...
(gdb) run -I. -c Test.m -o Test.o
Starting program: d:/Programs/llvm-d/bin/clang -I. -c Test.m -o Test.o
[New thread 1404.0x8bc]

Program received signal SIGSEGV, Segmentation fault.
0x0040ef2c in clang::driver::OptTable::ParseOneArg (this=0x3d4fe0, Args=@0x3d2e20, Index=@0x22f7e8)
    at d:/data/llvm/llvm-svn/tools/clang/lib/Driver/OptTable.cpp:255
255 if (Arg *A = getOption(id)->accept(Args, Index))
(gdb) bt
#0 0x0040ef2c in clang::driver::OptTable::ParseOneArg (this=0x3d4fe0, Args=@0x3d2e20, Index=@0x22f7e8)
    at d:/data/llvm/llvm-svn/tools/clang/lib/Driver/OptTable.cpp:255
#1 0x004036da in clang::driver::Driver::ParseArgStrings (this=0x22f950, ArgBegin=0x3d4ee4, ArgEnd=0x3d4ef8)
    at d:/data/llvm/llvm-svn/tools/clang/lib/Driver/Driver.cpp:83
#2 0x00403c7d in clang::driver::Driver::BuildCompilation (this=0x22f950, argc=6, argv=0x3d4ee0)
    at d:/data/llvm/llvm-svn/tools/clang/lib/Driver/Driver.cpp:185
#3 0x00402136 in main (argc=6, argv=0x3d4ee0) at d:/data/llvm/llvm-svn/tools/clang/tools/driver/driver.cpp:218
(gdb) list
250 if (Start == End)
251 break;
252
253 // See if this option matches.
254 options::ID id = (options::ID) (Start - OptionInfos + 1);
255 if (Arg *A = getOption(id)->accept(Args, Index))
256 return A;
257
258 // Otherwise, see if this argument was missing values.
259 if (Prev != Index)

Thanks,

Ronald

We tracked this down to a gcc miscompile. Worked around in r75518.

- Daniel