GNU G++ 2.7.2 (and later!) bug with exception handling!

GNU G++ 2.7.2 (and later!) bug with exception handling!

Post by Felix von Leitn » Tue, 12 Aug 1997 04:00:00



If you compile the program below with gcc on Intel and the run it, it
will not loop endlessly as expected, but it will eat all available RAM
and then die with "new: virtual memory exhausted".  Disassembly shows
that each throw mallocs one byte, which is not freed and you can't to it
either.  Can anyone reproduce this on systems other than Intel?

class E { };

blerg() {
  throw E;

Quote:}

main()
{
  while (1) {
    try {
      blerg();
    } catch (E) {
    }
  }

Quote:}


      [ about comp.lang.c++.moderated. First time posters: do this! ]
 
 
 

1. Exception handling bug w/Borland?

This simple chunk of code is wreaking havoc when run if compiled with
Borland 4.52 or 5.0.  Works fine in MSVC 4.0.  It produces an invalid
mem read just after the throw long(1); line.  Am I doing something wrong
or is it a borland bug?

Among other variations, if the break is placed outside the braces, the
problem goes away.

Thanks for any insight.
Jim Sermersheim

#include <stdio.h>

struct ABC
{
        ~ABC(){}

void Func1 (void)
{
        try
        {
                throw (int)2;
        }
        catch (int i)
        {
                switch (i)
                {
                        case 2:
                        {
                                ABC abc;
                                break;
                        }
                }
        }
        throw long(1);

void main (void)
{
        try
        {
                Func1();
        }
        catch (long exc)
        {
                printf("WooHoo!");
        }


      [ about comp.lang.c++.moderated. First time posters: do this! ]

2. Adding controls to main windows procedure in Vis C++

3. Exception safety with exceptions handling

4. Newsgroup for Mech Desktop?

5. exception handling not handling

6. BI Webcontrol and international cubes ?

7. Exception handling w/ repeated handling code

8. Quake3 - Biprocessor on WIN95

9. GNU C++ 2.5.7 BUG?: Pointer to Function Prototype Check

10. bug in gnu std including <string> & <vector>?

11. bug causes GNU objective-c runtime to not be thread-safe

12. GNU workaround for Intel performance bug?

13. gnu Collection bug?