Operating System - Linux
1748180 Members
4248 Online
108759 Solutions
New Discussion юеВ

Core dump when throw exception

 
SOLVED
Go to solution
Vadim Yezhakov
Advisor

Core dump when throw exception

Hi.
I have such problem.
System: HP-UX ahka B.11.23 U 9000/800 576770528 unlimited-user license
GCC 64-bit compiler 4.1.1
simple test:
--------------------------------------------
#include
#include
using namespace std;
int main(int argc, char** argv)
{
cout<<"Hello world from std exception"< try {
throw runtime_error("Runtime error");
}
catch(exception& err) {
cerr< }
return 0;
}
--------------------------------------------
compiled with string: g++ -g gcc64test.cpp -o gcc64test

When i run tis test, it core dumped.
When i try see core by GDB, it dumped in core itself.
On Itanium system this test works correctly.
3 REPLIES 3
Nik Gizdic
Frequent Advisor

Re: Core dump when throw exception

Vadim,

I am not a c++ programmer, I am more of a C programmer. However, I am wondering if you need the option for optimizing this code on hp-pa architecture.

Nik
Vadim Yezhakov
Advisor

Re: Core dump when throw exception

Hi Nik.
I don't listen about hp_pa optimization options for gcc. Can you give me some example?
Steve Ellcey
Valued Contributor
Solution

Re: Core dump when throw exception

This is a GCC alignment bug. It looks like it is in GCC 4.1.0 and 4.1.1. The bug does not appear to be in 4.0.3 and I tested no-yet-released versions of 4.1.2 and 4.2. These have the fix in them, so they should be OK when they are released. If you want to use officially released GCC bits I would recommend 4.0.3.

I don't believe there is any workaround for this problem since the problem is with the alignment of data in the GCC library.