This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libobjc/47922] New: [4.6 Regression] libobjc crashes with garbage collection in any real-life program
- From: "nicola at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Feb 2011 11:56:29 +0000
- Subject: [Bug libobjc/47922] New: [4.6 Regression] libobjc crashes with garbage collection in any real-life program
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47922
Summary: [4.6 Regression] libobjc crashes with garbage
collection in any real-life program
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: libobjc
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: nicola@gcc.gnu.org
>From Richard Frith-Macdonald (rfm@gnu.org) --
> I enabled gc and built base using the new compiler runtime, but as soon as
> I start any program, it segfaults.
>
> It appears that a bug has crept in to the libobjc type encoding handling,
> so when you call class_ivar_set_gcinvisible() for any class, you get a crash.
>
> The crash is a divide by zero in objc_layout_structure_next_member()
> (at line 1278 desired_align is zero).
>
> I think the problem is that the exclamation mark denoting a weak variable
> is not being handled in the function.
> On line 1208 objc_skip_type_qualifiers() is not skipping past it, then
> on line 1211 objc_alignof_type() is returning zero.
>
> Looking at the ChangeLog, I think you broke this on 2010-09-26 changing
> _C_GCINVISIBLE from '!' to '|' when parts of the code use a literal
> exclamation mark rather than the symbolic constant.
>
> Is it too late to get this fixed?
gc.c line 427 replace three lines with:
new_type[len++] = _C_GCINVISIBLE;
strcpy (new_type + len, type);