Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang++ crashes when compiling simple programs #1195

Closed
gyn opened this issue Mar 15, 2016 · 10 comments
Closed

clang++ crashes when compiling simple programs #1195

gyn opened this issue Mar 15, 2016 · 10 comments

Comments

@gyn
Copy link

gyn commented Mar 15, 2016

Hi guys,

I tried to use clang++ to build a program but failed. And then I tested clang++ with a simple program.

The command that I run is:

clang++ main.cpp -o main.exe -O3

My test program is very simple:

#include <iostream>

int main()
{
        std::cout << std::endl;

        return 0;
}

And this is the clang version:

$ pacman -Qs clang
local/mingw-w64-i686-clang 3.8.0-1
C language family frontend for LLVM (mingw-w64)

I am not sure if it is a LLVM or Clang bug but I would like to report bug here first.

Thanks.

Yanan

@gyn
Copy link
Author

gyn commented Mar 16, 2016

Hi guys,

Maybe the crash log would be usefull:

#0 0x04e97c60
#1 0x0028dfd0
#2 0x00e05481 _ZN12_GLOBAL__N_113SLPVectorizer13runOnFunctionERN4llvm8FunctionE.part.817.constprop.823 (C:\extra\msys32\home\yanan\MINGW-packages\mingw-w64-clang\src\build-i686\bin\clang++.exe+0xa05481)
#3 0x7783e36c RtlInitUnicodeString (C:\Windows\SysWOW64\ntdll.dll+0x2e36c)
#4 0x7783e0d2 RtlAllocateHeap (C:\Windows\SysWOW64\ntdll.dll+0x2e0d2)
#5 0x7783e36c RtlInitUnicodeString (C:\Windows\SysWOW64\ntdll.dll+0x2e36c)
#6 0x7783e0d2 RtlAllocateHeap (C:\Windows\SysWOW64\ntdll.dll+0x2e0d2)
#7 0x764a9d45 malloc (C:\Windows\syswow64\msvcrt.dll+0x9d45)
#8 0x6fef993a (C:\extra\msys32\mingw32\bin\libstdc++-6.dll+0xb993a)
#9 0x021d0c0d _ZNSt6vectorIN4llvm26BlockFrequencyInfoImplBase13FrequencyDataESaIS2_EE17_M_default_appendEj (C:\extra\msys32\home\yanan\MINGW-packages\mingw-w64-clang\src\build-i686\bin\clang++.exe+0x1dd0c0d)
#10 0x6fef993a (C:\extra\msys32\mingw32\bin\libstdc++-6.dll+0xb993a)
clang++.exe: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.8.0 (tags/RELEASE_380/final)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: C:\extra\msys32\home\yanan\MINGW-packages\mingw-w64-clang\src\build-i686\bin
clang++.exe: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang++.exe: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++.exe: note: diagnostic msg: C:\extra\msys32\tmp\main-59abff.cpp
clang++.exe: note: diagnostic msg: C:\extra\msys32\tmp\main-59abff.sh
clang++.exe: note: diagnostic msg:


Thanks.

Yanan

@rhornig
Copy link

rhornig commented Mar 17, 2016

Probably the same bug in the llvm/clang bugtracker: https://llvm.org/bugs/show_bug.cgi?id=26900#c1

@mati865
Copy link
Collaborator

mati865 commented Mar 26, 2016

Just tested with updated packages. No issue with -O0, -O1, -O2, -O3.

@gyn
Copy link
Author

gyn commented Mar 30, 2016

Hi Mati865,

Which clang do you use? mingw-w64-i686-clang or mingw-w64-i686-clang-svn. I tried again but still failed.

Thanks.

Yanan

@mati865
Copy link
Collaborator

mati865 commented Mar 30, 2016

$ pacman -Ss clang |grep "clang "
mingw32/mingw-w64-i686-clang 3.8.0-1 [installed]
mingw64/mingw-w64-x86_64-clang 3.8.0-1 [installed]

I also have full set of GCC tools.

@gyn
Copy link
Author

gyn commented Apr 1, 2016

Hi Mati865,

My PC runs Windows 7 x86. I redid as below:

  1. un-tared msys2-base-i686-20160205.tar
  2. run msys2_shell
  3. run update-core and then close windows
  4. run shell again, run "pacman -Su"
  5. run pacman -S mingw32/mingw-w64-i686-clang
  6. run pacman -S mingw-w64-i686-toolchain

But I still could see the crash.

Thanks.

Yanan

@gyn gyn closed this as completed Apr 1, 2016
@mati865
Copy link
Collaborator

mati865 commented Apr 1, 2016

Ok got crash using this steps. Probably clang and it's libs need to be rebuild.
P.S.
64bit clang is fine

EDIT: Could be related https://llvm.org/bugs/show_bug.cgi?id=11549

@Alexpux
Copy link
Member

Alexpux commented Apr 1, 2016

Rebuilding clang not help

@mati865
Copy link
Collaborator

mati865 commented Apr 1, 2016

In Cygwin i686-w64-mingw32-clang++ 3.7.1 doesn't crash. Maybe someone experienced with Cygwin could check what they changed?

@ms178
Copy link

ms178 commented May 24, 2016

Is there a status update to this bug? I've tried to compile zlib-ng; Intel's threading building blocks and lua 5.1 today with the most recent package of mingw-w64-i686-clang (3.8.0-3) but without success. The 64-bit-Clang version compiles fine, though (with appropriately modified Makefiles), as does GCC. But I need explicitly the 32-bit-DLL's for performance comparison and compatibility reasons. Are there any chances to get this fixed soon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants