public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/24025] New: libstdc++ crashes when out of memory exception thrown
@ 2005-09-22 22:00 geoffk at gcc dot gnu dot org
  2005-09-22 23:05 ` [Bug libstdc++/24025] " pinskia at gcc dot gnu dot org
  2005-09-23  9:45 ` pcarlini at suse dot de
  0 siblings, 2 replies; 3+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2005-09-22 22:00 UTC (permalink / raw)
  To: gcc-bugs

In __cxa_get_globals, the code does:

      if ((g = (__cxa_eh_globals *)
           std::malloc (sizeof (__cxa_eh_globals))) == 0
          || __gthread_setspecific (globals_key, (void *) g) != 0)
        std::terminate ();

but since __cxa_get_globals is called in __cxa_allocate_exception, the effect of this is that if the first 
exception thrown in a program is an out-of-memory exception, the program will instead call 
std::terminate, because it won't be able to allocate a new __cxa_eh_globals.  std::terminate itself 
expects __cxa_get_globals to work, so it'll call itself recursively, leading to an abort() in 
__verbose_terminate_handler.

-- 
           Summary: libstdc++ crashes when out of memory exception thrown
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: geoffk at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
  2005-09-22 22:00 [Bug libstdc++/24025] New: libstdc++ crashes when out of memory exception thrown geoffk at gcc dot gnu dot org
@ 2005-09-22 23:05 ` pinskia at gcc dot gnu dot org
  2005-09-23  9:45 ` pcarlini at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-22 23:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-22 23:04 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-22 23:04:26
               date|                            |


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
  2005-09-22 22:00 [Bug libstdc++/24025] New: libstdc++ crashes when out of memory exception thrown geoffk at gcc dot gnu dot org
  2005-09-22 23:05 ` [Bug libstdc++/24025] " pinskia at gcc dot gnu dot org
@ 2005-09-23  9:45 ` pcarlini at suse dot de
  1 sibling, 0 replies; 3+ messages in thread
From: pcarlini at suse dot de @ 2005-09-23  9:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-09-23 09:45 -------
Adding Rth in CC as the author of the fix of libstdc++/10606, which added the
call of __cxa_get_globals from __cxa_allocate_exception

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-09-23  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-22 22:00 [Bug libstdc++/24025] New: libstdc++ crashes when out of memory exception thrown geoffk at gcc dot gnu dot org
2005-09-22 23:05 ` [Bug libstdc++/24025] " pinskia at gcc dot gnu dot org
2005-09-23  9:45 ` pcarlini at suse dot de

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).