Opened 6 years ago

Closed 5 years ago

#56883 closed defect (fixed)

gdb @8.0.1: Please consider extending gdb's compiler blacklist to include Apple LLVM version 5.1 (clang-503.0.40)

Reported by: Hexchild Owned by: Mihai Moldovan <ionic@…>
Priority: Normal Milestone:
Component: ports Version: 2.5.3
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), Ionic (Mihai Moldovan), jmroot (Joshua Root)
Port: gdb

Description

The clang++ binary crashes on my machine while building the gdb package. This issue appears to be 100% reproducible, whether or not I run "sudo port clean gdb".

I have Xcode 5.1.1 on Mavericks (OSX 10.9.4):

$ clang++ --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

The culprit seems to be ada-lang.c (less relevant walls of text replaced with "..." for the sake of brevity):

$ cd /opt/local/var/macports/build/ ... _ports_devel_gdb/gdb/work/gdb-8.0.1/gdb
$ sudo /usr/bin/clang++ ... ada-lang.c
...
Stack dump:
0.	Program arguments: ... ada-lang.c 
1.	<eof> parser at end of file
2.	Per-module optimization passes
3.	Running pass 'CallGraph Pass Manager' on module 'ada-lang.c'.
4.	Running pass 'SROA' on function '@_ZL25ada_add_global_exceptionsP17re_pattern_bufferPP16VEC_ada_exc_info'
clang: error: unable to execute command: Segmentation fault: 11
...

I have verified that the macports llvm-6.0 version of clang++ does not crash when compiling this file on my system.

I see this was done in gdb's port file:

# clang 600.0.57 is known to segfault when building this
compiler.blacklist {clang >= 600 < 601}

Added here:

commit 30580e00386a4e862a2ba6654eac4a222d0a3ded
Author: Ryan Schmidt <ryandesign@macports.org>
Date:   Fri Nov 17 10:58:00 2017 -0600

    gdb: Blacklist clang 600

I highly suspect I have the same issue but with a different LLVM version, however I can't be sure since I can't find a ticket for the above change. Regardless, the crash I'm seeing should probably be avoided.

Attachments (1)

main.log.bz2 (461.6 KB) - added by Hexchild 6 years ago.
Compressed main.log

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Hexchild

Attachment: main.log.bz2 added

Compressed main.log

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Keywords: gdb ada-lang segfault crash removed

comment:2 Changed 6 years ago by Hexchild

Just adding for the sake of clarification and completeness that I do get a functional gdb (which I've been using successfully for the last couple of days) if I change it locally to:

compiler.blacklist {clang => 500 < 601}

This is a hack, not a proposed solution. I have no idea what the correct version range(s) might be.

comment:3 Changed 5 years ago by Ionic (Mihai Moldovan)

Cc: ryandesign ionic jmroot added; ryandesign@… removed

First observation: you shouldn't be using Xcode 5.1 on 10.9. Update to 6.2, which is essentially the only combination we can be asked to reasonably support (notwithstanding the fact that 10.9 is long obsolete anyway).

Secondly: incidentally, this bug was fixed (or worked around) by the fix committed as part of #57877, but now resurfaces (even with clang as shipped in Xcode 6.2, which has the version number 600) after dcc120953e39660f62aed7c33c324bfa1d4c0206/macports-ports.

I believe that removing the blacklist completely was not intentional and merely a mistake while doing the mass update?

I'd like to re-instantiate the blacklist for at least something like clang < 601. We probably don't need to go as broad as < 801 again because the port built on 10.10+ and only failed on 10.9-.

Last edited 5 years ago by Ionic (Mihai Moldovan) (previous) (diff)

comment:4 Changed 5 years ago by Ionic (Mihai Moldovan)

Cc: Ionic added; ionic removed

Case sensitivity in user names, I'll never get that right...

comment:5 Changed 5 years ago by jmroot (Joshua Root)

Hm, not sure what happened there. Maybe I was going to check which C++ standard was actually needed and just forgot about it. Looks like it's C++11. So yeah, go ahead and blacklist clang < 601 again, with a comment saying that it's because older clangs segfault, and add compiler.cxx_standard 2011 as well just for informational purposes.

comment:6 Changed 5 years ago by Mihai Moldovan <ionic@…>

Owner: set to Mihai Moldovan <ionic@…>
Resolution: fixed
Status: newclosed

In 87e4171bf949e57bdbf44931af21c36307e43595/macports-ports (master):

devel/gdb: blacklist clang prior to Xcode 6.3 due to segfaults.

Also mention that the port needs C++11 support and make sure that it
doesn't pick older (Apple) GCC versions incidentally.

Should be a build fix only, so no revbump.

Fixes: #56883

Note: See TracTickets for help on using tickets.