Between 20100628 and 20100705, all Objective-C execution tests started to fail
on
Solaris 2/SPARC.  E.g,

FAIL: objc.dg/bitfield-1.m -fgnu-runtime execution test

bitfield-1.exe SEGVs with this stacktrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
sel_get_name (selector=0x0) at
/vol/gcc/src/hg/trunk/solaris/libobjc/selector.c:299
(gdb) where
#0  sel_get_name (selector=0x0) at
/vol/gcc/src/hg/trunk/solaris/libobjc/selector.c:299
#1  0xfeb7e8a0 in -[Object notImplemented:] (self=0x20eb4, _cmd=0xfeb97c5c,
aSel=0x0) at /vol/gcc/src/hg/trunk/solaris/libobjc/Object.m:306
#2  0xfeb7e420 in +[Object conformsTo:] (self=<value optimized out>,
_cmd=<value optimized out>, aProtocol=0xfea35800) at
/vol/gcc/src/hg/trunk/solaris/libobjc/Object.m:213
#3  0x00010af4 in main ()

The selector argument to sel_get_name is NULL, so a NULL pointer is
dereferenced.
Unless there is a generic code generation bug here, I strongly suspect this
patch:

2010-07-03  Nathan Froyd  <froy...@codesourcery.com>

        PR objc/24867
        * objc-act.c (build_sized_array_type): New function.
        (add_objc_string): Use it.
        (generate_protocol_list): Likewise.
        (generate_objc_image_info): Likewise.
        (add_field_decl): New function.
        (objc_build_struct): Use a VEC rather than building a TREE_LIST.
        (generate_struct_by_value_array): Use add_field_decl.
        (build_objc_symtab_template): Likewise.
        (build_module_descriptor): Likewise.
        (build_objc_exception_stuff): Likewise.
        (build_protocol_template): Likewise.
        (build_method_prototype_list_template): Likewise.
        (build_method_prototype_template): Likewise.
        (build_category_template): Likewise.
        (build_selector_template): Likewise.
        (build_class_template): Likewise.
        (build_super_template): Likewise.
        (build_ivar_template): Likewise.
        (build_ivar_list_template): Likewise.
        (build_method_list_template): Likewise.


-- 
           Summary: [4.6 regression] All Objective-C execution tests fail on
                    Solaris 2/SPARC
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: objc
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ro at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2*
  GCC host triplet: sparc-sun-solaris2*
GCC target triplet: sparc-sun-solaris2*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44887

Reply via email to