This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/13391] AIX: crash on throw/catch between shared objects


------- Additional Comments From ddurham_gcc_bz at davyandbeth dot com  2003-12-23 23:48 -------
Hi,
  I'm experiencing this too... Except I've discovered it doesn't have anything
to do with shared libs...

I'm using gcc-3.3.2 on AIX 4.3.3.0



Try this:

---- main.cpp ----

#include <stdexcept>

extern void foo();

int bogus;

int main()
{
        try
        {
                foo();
        }
        catch(std::exception &e)
        {
        }
        catch(...)
        {
        }

        return 0;
}

---- foo.cpp ----

#include <stdexcept>

int bogus;

void foo()
{
        throw std::runtime_error("test");
}

---- now compile it with:
	g++ main.cpp foo.cpp  

You may need to add "-Xlinker --allow-multiple-definition" if you're using GNU's ld.

For me, a.out will produce

	IOT/Abort trap (core dumped)


Now comment out the definition of bogus() in either source file.  Then I get no
problem.  I never use bogus.. it's just if it's there, then the problem exists. 
The same think will occur if you make 'bogus' not an int but a function.  I
guess it's just that if there are any duplicate symbols the problem occurs.

I really need to get this resolved.  Please let me know if you find out anything.

Thanks,
   Davy

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]