public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars
@ 2012-01-18 10:07 tilo at pruetz dot net
  2012-01-19  1:36 ` [Bug libobjc/51891] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tilo at pruetz dot net @ 2012-01-18 10:07 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51891
           Summary: class_copyIvarList crashes on empty ivars
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: libobjc
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tilo@pruetz.net


Created attachment 26361
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26361
simple example

When calling class_copyIvarList(class, NULL) with a class that has no ivars the
app crashes with a segfault.

Please find an example attached.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libobjc/51891] class_copyIvarList crashes on empty ivars
  2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
@ 2012-01-19  1:36 ` pinskia at gcc dot gnu.org
  2012-09-16 15:21 ` dpapavas at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-19  1:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libobjc/51891] class_copyIvarList crashes on empty ivars
  2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
  2012-01-19  1:36 ` [Bug libobjc/51891] " pinskia at gcc dot gnu.org
@ 2012-09-16 15:21 ` dpapavas at gmail dot com
  2014-12-08 21:31 ` larry.campbell at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dpapavas at gmail dot com @ 2012-09-16 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Dimitris Papavasiliou <dpapavas at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dpapavas at gmail dot com

--- Comment #1 from Dimitris Papavasiliou <dpapavas at gmail dot com> 2012-09-16 15:21:04 UTC ---
The runtime crashes at libobj.c/ivars.c line 191:

count = ivar_list->ivar_count;

The problem is that, when a class has no instance variables ivar_list will be
NULL so this needs to be checked for.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libobjc/51891] class_copyIvarList crashes on empty ivars
  2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
  2012-01-19  1:36 ` [Bug libobjc/51891] " pinskia at gcc dot gnu.org
  2012-09-16 15:21 ` dpapavas at gmail dot com
@ 2014-12-08 21:31 ` larry.campbell at gmail dot com
  2014-12-24 16:28 ` dpapavas at gmail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: larry.campbell at gmail dot com @ 2014-12-08 21:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51891

--- Comment #2 from Larry Campbell <larry.campbell at gmail dot com> ---
Is anyone going to fix this? It is quite debilitating and there is no good
workaround. Prior to gcc 4.6 one could include
objc/deprecated/struct_objc_class.h and inspect ivar_list yourself before
calling class_copyIvarList. Now that the ABI internals are private, this is no
longer an option, and it's impossible to protect against.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libobjc/51891] class_copyIvarList crashes on empty ivars
  2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
                   ` (2 preceding siblings ...)
  2014-12-08 21:31 ` larry.campbell at gmail dot com
@ 2014-12-24 16:28 ` dpapavas at gmail dot com
  2015-01-09 18:13 ` mrs at gcc dot gnu.org
  2015-01-09 18:14 ` mrs at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dpapavas at gmail dot com @ 2014-12-24 16:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51891

--- Comment #3 from Dimitris Papavasiliou <dpapavas at gmail dot com> ---
Created attachment 34329
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34329&action=edit
A patch that fixes the issue and provides a suitable testcase.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libobjc/51891] class_copyIvarList crashes on empty ivars
  2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
                   ` (3 preceding siblings ...)
  2014-12-24 16:28 ` dpapavas at gmail dot com
@ 2015-01-09 18:13 ` mrs at gcc dot gnu.org
  2015-01-09 18:14 ` mrs at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mrs at gcc dot gnu.org @ 2015-01-09 18:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51891

--- Comment #4 from mrs at gcc dot gnu.org <mrs at gcc dot gnu.org> ---
Author: mrs
Date: Fri Jan  9 18:12:51 2015
New Revision: 219399

URL: https://gcc.gnu.org/viewcvs?rev=219399&root=gcc&view=rev
Log:
Added PR libobjc/51891.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libobjc/ChangeLog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libobjc/51891] class_copyIvarList crashes on empty ivars
  2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
                   ` (4 preceding siblings ...)
  2015-01-09 18:13 ` mrs at gcc dot gnu.org
@ 2015-01-09 18:14 ` mrs at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: mrs at gcc dot gnu.org @ 2015-01-09 18:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51891

mrs at gcc dot gnu.org <mrs at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |mrs at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #5 from mrs at gcc dot gnu.org <mrs at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-09 18:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-18 10:07 [Bug libobjc/51891] New: class_copyIvarList crashes on empty ivars tilo at pruetz dot net
2012-01-19  1:36 ` [Bug libobjc/51891] " pinskia at gcc dot gnu.org
2012-09-16 15:21 ` dpapavas at gmail dot com
2014-12-08 21:31 ` larry.campbell at gmail dot com
2014-12-24 16:28 ` dpapavas at gmail dot com
2015-01-09 18:13 ` mrs at gcc dot gnu.org
2015-01-09 18:14 ` mrs at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).