public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [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
  1 sibling, 0 replies; 11+ messages in thread
From: xiaoyuanbo at yeah dot net @ 2012-02-22 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

xiaoyuanbo <xiaoyuanbo at yeah dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xiaoyuanbo at yeah dot net

--- Comment #10 from xiaoyuanbo <xiaoyuanbo at yeah dot net> 2012-02-22 12:52:15 UTC ---
i know you are


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-4@http.gcc.gnu.org/bugzilla/>
  2012-02-22 13:10 ` [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown xiaoyuanbo at yeah dot net
@ 2012-11-05 18:21 ` jifl-bugzilla at jifvik dot org
  1 sibling, 0 replies; 11+ messages in thread
From: jifl-bugzilla at jifvik dot org @ 2012-11-05 18:21 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Larmour <jifl-bugzilla at jifvik dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jifl-bugzilla at jifvik dot
                   |                            |org

--- Comment #11 from Jonathan Larmour <jifl-bugzilla at jifvik dot org> 2012-11-05 18:21:18 UTC ---
I'm quite surprised to find that this problem still exists in the current trunk
for platforms without TLS (i.e. many embedded platforms). Although I don't see
a recursive call but a rather more direct chain of events:

1) We completely run out of heap memory calling operator new. To see this
problem, less than the size of 'struct __cxa_eh_globals' must be available.

2) new throws std::bad_alloc, causing __cxa_allocate_exception to be called

3) __cxa_allocate_exception calls malloc() which still fails, but an emergency
buffer is available, so it is able to continue.

4) But __cxa_allocate_exception then calls __cxa_get_globals()

5) If __cxa_get_globals() has not been called before, it will allocate the
globals structure beginning with a call to malloc()

6) malloc() still fails, so std::terminate() is called.

The effect is that if std::bad_alloc is the first C++ exception this thread has
thrown, we can never catch it - instead the program is always abruptly
terminated, by default with abort(). This seems to be a surprisingly serious
issue given this is a 7 year old bug report.

Jifl


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2005-12-02 18:13 ` pcarlini at suse dot de
@ 2006-10-23 16:26 ` pcarlini at suse dot de
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2006-10-23 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pcarlini at suse dot de  2006-10-23 16:26 -------
The issue seems more tricky, even for TLS platforms, see:

  http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00333.html


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2005-12-02 18:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pcarlini at suse dot de  2005-12-02 18:13 -------
If my analysis is correct, this PR is still valid *only* for targets not
defining _GLIBCXX_HAVE_TLS. Otherwise, fixed by:

2005-11-21  Benjamin Kosnik  <bkoz@redhat.com>
            Ulrich Drepper  <drepper@redhat.com>

        PR libstdc++/23591


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2005-12-02 18:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pcarlini at suse dot de  2005-12-02 18:07 -------
Ah! Now I see, it's because of Benjamin and Ulrich recent changes, involving
thread local storage. Therefore my amended testcase proposal should be fine on
platforms not defining _GLIBCXX_HAVE_TLS. We should check that.


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2005-12-02 18:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pcarlini at suse dot de  2005-12-02 18:02 -------
Created an attachment (id=10392)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10392&action=view)
Puzzling testcase...

Humm, strange. The new testcase *passes*... Still, the original analysis makes
a lot of sense to me (like Howard's suggestion for a fix). But we badly need a
testcase! Any idea?


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
  2005-12-02 17:40 ` 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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2005-12-02 17:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pcarlini at suse dot de  2005-12-02 17:51 -------
... possibly using a "real" memory allocation, touching all the involved pages.


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
  2005-12-02 17:40 ` 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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2005-12-02 17:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pcarlini at suse dot de  2005-12-02 17:50 -------
Sorry. Actually the testcase is not correct stand-alone, fails at line 13. I'm
currently checking whether is correct when the testsuite support (memory
limits) is present.


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
       [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
@ 2005-12-02 17:40 ` pcarlini at suse dot de
  2005-12-02 17:50 ` pcarlini at suse dot de
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: pcarlini at suse dot de @ 2005-12-02 17:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pcarlini at suse dot de  2005-12-02 17:40 -------
Created an attachment (id=10391)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10391&action=view)
Trivial testcase

Hi. I'm attaching a trivial testcase (*). In fact, I consider this bug pretty
serious! Howard, any chance you can show your patch to Geoff or post it to the
mailing list(s) for a review?

(*) Of course, it reliably fails stand-alone, without the def-out bits, only on
32-bit machines equipped with less than ~ 1G.


-- 


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


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

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
  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
  1 sibling, 0 replies; 11+ 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] 11+ messages in thread

* [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown
  2005-09-22 22:00 [Bug libstdc++/24025] New: " 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; 11+ 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] 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-4@http.gcc.gnu.org/bugzilla/>
2012-02-22 13:10 ` [Bug libstdc++/24025] libstdc++ crashes when out of memory exception thrown xiaoyuanbo at yeah dot net
2012-11-05 18:21 ` jifl-bugzilla at jifvik dot org
     [not found] <bug-24025-638@http.gcc.gnu.org/bugzilla/>
2005-12-02 17:40 ` 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
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).