FS#48203 - [clang] crashes when compile with -Winvalid-pch

Attached to Project: Arch Linux
Opened by Weitian Leung (timxx) - Tuesday, 16 February 2016, 09:16 GMT
Last edited by Evangelos Foutras (foutrelis) - Saturday, 07 May 2016, 16:33 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

After gcc abi changed, clang isn't works well anymore.

When clang compile with -Winvalid-pch flag, set -I to a long include path (24+ characters as my test),
and uses lambda, call std::find_if, clang will crashes when compile.

The important conditions are:
- compile with -Winvalid-pch
- uses Precompiled Header
- -I to include a 24+ characters path (exists or not isn't that important)
- call std::find_if inside lambda

You can change the Makefile CFLAGS/LFLAGS from clang-bug.zip,
e.g. change /usr/aaaaaaaaaaa/include to /usr/include/qt4/QtMultimedia,
or remove the -stdlib=libc++ flag,
clean and recompile, clang still crashes.

Thus, the include path and libc++ isn't the point to crash. (But the include path still need long enough)

GCC works.
Another strange things is, our project can compile with debug build (-O0),
but this demo pass -O0 or not take no effects.

PS, only tested in x64 machine.
I don't known is this Arch Linux relative or clang's bug.
But before gcc abi changed, everythings works.
 FS#47329  might not really fixed.

This is so annoying with abi changed. :(

Additional info:
* clang 3.7.1-1

Steps to reproduce:

Download the clang-bug.zip attachment, extract it.
make pch && make

You will see a Segmentation fault (clang.log for details).
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Saturday, 07 May 2016, 16:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  clang 3.8.0-1
Comment by Weitian Leung (timxx) - Tuesday, 16 February 2016, 09:48 GMT
Now I tested with official pre-built binaries (Clang for x86_64 Ubuntu 15.10), it works as expected.
So this is should be a bug of Arch Linux. :(
Comment by EQ (vityafx) - Saturday, 05 March 2016, 15:22 GMT
This may be caused by a clang patch. More information is in clang bugtracker.
I can't check this by myself but this may be related.

LLVM bugtracker: https://llvm.org/bugs/show_bug.cgi?id=25969#c19
Comment by Błażej Szczygieł (zaps166) - Thursday, 10 March 2016, 23:22 GMT
https://llvm.org/bugs/show_bug.cgi?id=25969#c20 is closed as invalid (again).
Looks like http://reviews.llvm.org/D12834 (clang-3.7.0-add-gcc-abi-tag-support.patch) is buggy and unsupported, so it shouldn't be used in this package.
For gcc's attribute abi_tag, follow http://llvm.org/pr23529 instead.

Loading...