public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-24025-4@http.gcc.gnu.org/bugzilla/>]
* [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; 11+ 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] 11+ messages in thread

end of thread, other threads:[~2012-11-05 18:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
2005-12-02 17:40 ` [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown pcarlini at suse dot de
2005-12-02 17:50 ` pcarlini at suse dot de
2005-12-02 17:51 ` pcarlini at suse dot de
2005-12-02 18:02 ` pcarlini at suse dot de
2005-12-02 18:08 ` pcarlini at suse dot de
2005-12-02 18:13 ` pcarlini at suse dot de
2006-10-23 16:26 ` pcarlini at suse dot de
     [not found] <bug-24025-4@http.gcc.gnu.org/bugzilla/>
2012-02-22 13:10 ` xiaoyuanbo at yeah dot net
2012-11-05 18:21 ` jifl-bugzilla at jifvik dot org
2005-09-22 22:00 [Bug libstdc++/24025] New: " 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).