Bug 791365
Summary: | clang segfaults on 64-bit build, works on 32-bit | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Matthew Garrett <mjg> |
Component: | llvm | Assignee: | Michel Lind <michel> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 17 | CC: | bos, dmalcolm, jakub, jfeeney, kalevlember, michel, the.ridikulus.rat |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | llvm-3.0-10.fc17 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-04-12 03:21:45 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Matthew Garrett
2012-02-16 20:35:39 UTC
Suspect this is http://llvm.org/bugs/show_bug.cgi?id=11926 I poked a bit at llvm/clang and rebuilding it with -O0 instead of -O2 fixed it for me. Certainly sounds very similar to the llvm bug linked in comment #1. Going to see if I can nail it down to a single optimization flag, instead of just turning everything off. I managed to track it down to -ftree-pre that is enabled with -O2. When clang is built with gcc 4.7 using explicit "-O2 -fno-tree-pre", the build works fine on x86_64. Without it, clang segfaults building pretty much anything. I suspect this might be a gcc 4.7 optimization bug; apparently clang in Fedora isn't fully bootstrapped and is built using gcc. Adding Jakub Jelinek to CC for opinions. If -O2 -fno-tree-pre works and -O2 doesn't, first narrow it down using a binary search between -O2 -fno-tree-pre and -O2 compiled objects to at least a single compilation unit, then you could use __attribute__((optimize (1))) (resp. __attribute__((optimize (2))) ) and/or -fno-inline to narrow it even further, read the problematic code, see if there aren't any e.g. aliasing warnings (-O2 enables -fstrict-aliasing), if you don't spot a bug in the gforth code after this and still suspect the compiler, turn that into self-contained minimal testcase (for the problematic routine add main that calls it with the right arguments, make the problematic routine __attribute__((noinline, noclone)) and stub out anything it calls, then file a gcc bugreport? Thanks Jakub for the pointers. This will make it much easier to track down. Regarding aliasing warnings, apparently clang explicitly passes -fno-strict-aliasing to the compiler. However, Fedora RPM %{optflags} are inserted after -fno-strict-aliasing, so I guess the -O2 from %{optflags} negates the explicit -fno-strict-aliasing. In the mean time, I've built llvm-3.0-10 with -fno-tree-pre that should work around the crash for now. P.S. Some more info about the same clang segfault is at https://bugzilla.redhat.com/show_bug.cgi?id=800478 No, -fno-strict-aliasing -O2 doesn't enable strict aliasing, -O2 turns it on only when -f{,no-}strict-aliasing isn't explicit, otherwise only -fno-strict-aliasing -O2 -fstrict-aliasing would turn it back on. llvm-3.0-10.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/llvm-3.0-10.fc17 Package llvm-3.0-10.fc17: * should fix your issue, * was pushed to the Fedora 17 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing llvm-3.0-10.fc17' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-4812/llvm-3.0-10.fc17 then log in and leave karma (feedback). llvm-3.0-10.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report. |