Using c++ to compile specific code crashes the compiler. The compiler then spits out instructions to include files, and submit a bug. I searched for "llvm crash" and didn't get any hits. ---- llvm output snap shot ---- (516 / 16) [~/src/vs.git/t2]$: gmake clean test rm -f prog *.core main.o main.d c++ -Wno-unused -MP -MD -std=c++11 -g3 -ggdb -fblocks -I. -I/usr/local/include -c main.cpp -o main.o c++: error: unable to execute command: Segmentation fault (core dumped) c++: error: clang frontend command failed due to signal (use -v to see invocation) FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) Target: x86_64-unknown-freebsd11.1 Thread model: posix InstalledDir: /usr/bin c++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script. c++: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: c++: note: diagnostic msg: /tmp/main-8ed6cc.cpp c++: note: diagnostic msg: /tmp/main-8ed6cc.sh c++: note: diagnostic msg: ******************** gmake: *** [Makefile:72: main.o] Error 254 (neal@xxxx.xxxxxxx.com) 19:13:00 (518 / 18) [~/src/vs.git/t2]$: uname -a FreeBSD xxxx.xxxxxxx.com 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0: Tue Nov 14 06:12:40 UTC 2017 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 (neal@xxxx.xxxxxxx.com) 19:52:08 (519 / 19) [~/src/vs.git/t2]$: --- end output snap shot ---
Also, forgot to mention, this same code also crashes llvm on Darwin, so a radar:39926584 has also been reported by me.
(In reply to neal from comment #0) > Preprocessed source(s) and associated run script(s) are located at: > c++: note: diagnostic msg: /tmp/main-8ed6cc.cpp > c++: note: diagnostic msg: /tmp/main-8ed6cc.sh Maybe attach main.cpp or compiler preprocessed source.
Created attachment 193022 [details] llvm crash output minus the llvm .core file, it's bigger than allowed.
Sorry about that. I missed that the attachment with the .core file didn't make it because of size.
I can reproduce, also with newer versions of clang. If assertions are enabled, it gives: Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /usr/src/contrib/llvm/include/llvm/Support/Casting.h, line 255. Minimized test case: // clang -cc1 -triple x86_64-- -S -fblocks bug227941-min.cpp class a { public: template <class b> a(b); }; class { public: int c(a); } d; void f() { __attribute__((__blocks__(byref))) int e = d.c([] {}); } Submitted upstream as: https://bugs.llvm.org/show_bug.cgi?id=37328
^Triage: to submitter: is this still a problem in modern versions of clang?