FS#47536 - [clang] segfault: return lambda from function

Attached to Project: Arch Linux
Opened by Vittorio Romeo (vittorioromeo) - Saturday, 26 December 2015, 15:52 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 26 December 2015, 17:03 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

auto fixed(){ return []{}; }
int main(){ return 0; }

---

The above minimal example produces a segmentation fault on my machine.
Package version: "clang 3.7.0-6".

I don't think this is a duplicate of
https://bugs.archlinux.org/task/47348
because 47348 claims the bug is ABI-related and that the bug happens only when libc++ is being used.

The above minimal example segfaults both with libstdc++ and libc++ on my machine.

clang++ -std=c++14 ./bug_clang.cpp
clang++ -std=c++14 -stdlib=libstdc++ ./bug_clang.cpp
clang++ -std=c++14 -stdlib=libc++ ./bug_clang.cpp

All the above commands produce a segmentation fault.

---

Note that the segmentation fault does not happen on the following online compilers:
https://goo.gl/hZDt4S
http://coliru.stacked-crooked.com/a/cd33d1b7f7104bea

I think this is related to the ABI breakage, but not a duplicate of 47348.

---

clang-3.7: error: unable to execute command: Segmentation fault (core dumped)
clang-3.7: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.7.0 (tags/RELEASE_370/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3.7: 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-3.7: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.7: note: diagnostic msg: /tmp/bug_clang-ed354e.cpp
clang-3.7: note: diagnostic msg: /tmp/bug_clang-ed354e.sh
clang-3.7: note: diagnostic msg:

********************

---

I've attached the generated files.
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Saturday, 26 December 2015, 17:03 GMT
Reason for closing:  Duplicate
Additional comments about closing:  Yup, it's a runaway recursion with this test case too. ( FS#47329 )
Comment by Vittorio Romeo (vittorioromeo) - Saturday, 26 December 2015, 15:54 GMT
By "47348" I actually meant "47329":
https://bugs.archlinux.org/task/47329

Sorry about the confusion.
Comment by Evangelos Foutras (foutrelis) - Saturday, 26 December 2015, 16:28 GMT
Probably the same underlying issue as the other reports: http://reviews.llvm.org/D12834#311890

Loading...