public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51549] New: QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1
@ 2011-12-14  7:45 sami.lehtonen at digia dot com
  2011-12-14  7:49 ` [Bug c++/51549] " sami.lehtonen at digia dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sami.lehtonen at digia dot com @ 2011-12-14  7:45 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51549
           Summary: QList::operator[] crash in 32bit release version on
                    MacOS for gcc 4.2.1
    Classification: Unclassified
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: sami.lehtonen@digia.com


Created attachment 26076
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26076
Example application to reproduce the issue

There is a bug in the way how gcc optimizes QList::operator[] so that it leads
to a crash on MacOS. 


Detailed description:
This can be reproduced only when building a release version of the application
with Qt 4.7.3 (or newer, we didn't tried with older Qt versions) to MacOS
Carbon or 32bit Cocoa. One of our testing computer (to reproduce the issue) is
running with Xcode 3.2.6 (containing gcc 4.2.1 Apple build 5666) and MacOS
10.6.8. The problem will also be visible if you let qmake generate a Xcode
project rather than a Makefile.

This cannot be reproduced with debug version in Carbon/32bit Cocoa. And this
cannot be reproduced at all if building to 64bit Cocoa. Also, this cannot be
reproduced if using the flag -fno-tree-vrp in gcc or if building with llvm-gcc.
When using Qt 4.5.3, Xcode 3.1.4 (containing gcc 4.0.1 Apple build 5493) on
MacOS 10.5.8 this cannot be reproduced. We haven't been able to reproduced this
on Windows/Linux computers.


Other information:
The QList::operator[] is compiled as "inline" for the release version. When
building for the debug version the functionality is not compiled inline and
there are no crashes observed.


Workaround:
Use QList::value() instead of QList::operator[]
Note: QList::value() is neither compiled as inline for debug nor for release
version.


Example code to reproduce the problem:
Build the attached example application with:
qmake -spec macx-g++
make

Start the application:
./testQListAccess.app/Contents/MacOS/testQListAccess

-> crash in CPoint::x() because the reference to this object which was passed
by QList::operator[] is wrong.
You can deactivate in the example code in the file testQListAccess.cpp the line
138 where the QList::operator[] is used and activate the code part at line 140
which is using QList::value(). With this "workaround" the application will run.


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

* [Bug c++/51549] QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1
  2011-12-14  7:45 [Bug c++/51549] New: QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1 sami.lehtonen at digia dot com
@ 2011-12-14  7:49 ` sami.lehtonen at digia dot com
  2011-12-14 11:03 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: sami.lehtonen at digia dot com @ 2011-12-14  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from sami.lehtonen at digia dot com 2011-12-14 07:44:59 UTC ---
Created attachment 26077
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26077
Crash report


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

* [Bug c++/51549] QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1
  2011-12-14  7:45 [Bug c++/51549] New: QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1 sami.lehtonen at digia dot com
  2011-12-14  7:49 ` [Bug c++/51549] " sami.lehtonen at digia dot com
@ 2011-12-14 11:03 ` redi at gcc dot gnu.org
  2011-12-15  9:31 ` sami.lehtonen at digia dot com
  2011-12-15 20:46 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2011-12-14 11:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID
           Severity|critical                    |normal

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-14 10:58:51 UTC ---
The GCC project no longer supports GCC 4.2.1, so either try a newer version or
report it to your vendor. You're using an Apple build, so bugs should be
reported to Apple.


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

* [Bug c++/51549] QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1
  2011-12-14  7:45 [Bug c++/51549] New: QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1 sami.lehtonen at digia dot com
  2011-12-14  7:49 ` [Bug c++/51549] " sami.lehtonen at digia dot com
  2011-12-14 11:03 ` redi at gcc dot gnu.org
@ 2011-12-15  9:31 ` sami.lehtonen at digia dot com
  2011-12-15 20:46 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: sami.lehtonen at digia dot com @ 2011-12-15  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

sami.lehtonen at digia dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |
           Severity|normal                      |critical

--- Comment #3 from sami.lehtonen at digia dot com 2011-12-15 09:23:21 UTC ---
The case is now moved to Apple's bug database. The new case can be found with
id 10585486.


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

* [Bug c++/51549] QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1
  2011-12-14  7:45 [Bug c++/51549] New: QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1 sami.lehtonen at digia dot com
                   ` (2 preceding siblings ...)
  2011-12-15  9:31 ` sami.lehtonen at digia dot com
@ 2011-12-15 20:46 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-12-15 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-12-15 20:35:11 UTC ---
The bug is still invalid here as we don't support the compiler that Apple
provides, only the one which is located on gcc.gnu.org.


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

end of thread, other threads:[~2011-12-15 20:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-14  7:45 [Bug c++/51549] New: QList::operator[] crash in 32bit release version on MacOS for gcc 4.2.1 sami.lehtonen at digia dot com
2011-12-14  7:49 ` [Bug c++/51549] " sami.lehtonen at digia dot com
2011-12-14 11:03 ` redi at gcc dot gnu.org
2011-12-15  9:31 ` sami.lehtonen at digia dot com
2011-12-15 20:46 ` pinskia 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).