Application is dropping core when there is an exception

Hi,

We are using sun studio 9 on Solaris 9. If an exception is thrown in the application, even though there is a try/catch block, the application is dropping core.

Any one has any idea on this kind of problem. If I write a simple application everything is working fine. But in the actual application we are including many third party libraries etc.. and the the application is causing this problem.

If I any one come across this kind of the problem, please provide me the points to resolve this problem.

[528 byte] By [kumar110] at [2007-11-26 10:52:51]
# 1

Two possibilities:

1. No active catch block matches the exception that is thrown (programming error).

2. Compiler bug.

To reduce the chances that your are running into a compiler bug, get Sun Studio 11, update with the current patches, and update Solaris with the current C++ runtime library patches.

Sun Studio 11 is free for all uses. You can get it here:

http://developers.sun.com/sunstudio

You can get all patches here:

http://developers.sun.com/sunstudio/downloads/patches/index.jsp

clamage45 at 2007-7-7 3:05:47 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

Thanks for the reply.

The application is working fine if incrementally linking is off.But the same application is dropping core if incrementally linking is on

I am using the below sample code for testing purpose

#include <iostream.h>

class MyException

{

public:

int eventNo;

MyException() {

eventNo = 0;

}

MyException(int No) {

eventNo = No ;

}

};

void myfunc()

{

throw MyException(10);

}

int main()

{

try

{

myfunc();

}

catch ( MyException &x )

{

cout << "I am in catch block " << endl;

}

}

The application is working fine if incremantall linking is off. ( I am also including few third party libraries as well )

I can not go with sun studio 11 as it requires a lot of approvals from many guys and all the third party libraries we are using in our application are not certified on studio 11.

Pl help me in understanding the reason why the application is working if I turn off incremenal linking. Are there any know issues with the incremental linking?

Thanks,

Naresh

kumar110 at 2007-7-7 3:05:47 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
Do not use the incremental linker. We dropped it from the product in a recent release because we cannot keep it in syncy with changes in the Solaris linker.
clamage45 at 2007-7-7 3:05:47 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4
Thanks for the information. I will remove the incremental linking from the application.Just curious to know whether you come across any such scenarios where the incremental linker caused the try catch block to work incorrectly.Thanks,Naresh
kumar110 at 2007-7-7 3:05:47 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5
We stopped using and supporting ild because it had many problems. I don't remember whether exception handling was one of the problems.
clamage45 at 2007-7-7 3:05:47 > top of Java-index,Development Tools,Solaris and Linux Development Tools...