"exception not rethrown" problem

D

D'artagnan

I'm using Pthreads in a C++ program that uses exceptions. When one
thread is cancelled (cancellation state is deferred) by the main
thread, it throws some mysterious exception which cannot even be caught

by "catch(...)". The program aborts with the following error message:

FATAL: exception not rethrown
Abort


Anybody have ideas how to avoid this problem? Specifically, how to
catch the cancellation exception, or how to ignore it? Thanks a lot.
 
M

mlimber

D'artagnan said:
I'm using Pthreads in a C++ program that uses exceptions. When one
thread is cancelled (cancellation state is deferred) by the main
thread, it throws some mysterious exception which cannot even be caught

by "catch(...)". The program aborts with the following error message:

FATAL: exception not rethrown
Abort


Anybody have ideas how to avoid this problem? Specifically, how to
catch the cancellation exception, or how to ignore it? Thanks a lot.

No idea, and since standard C++ knows naught of pthreads, you'll want
to post in a more appropriate newsgroup (I see you've already posted to
comp.programming.threads, but you might want to try one for your
platform as well). See this FAQ for what is on topic here:

http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

Cheers! --M
 
R

Ray Gardener

Stack overflow is one class of exception that can be uncatchable, since
the stack is in too poor a state to be unwound by the exception handling
system. Maybe you have a re-entrant or recursive routine? Or a method
overriden to accept different argument types but one of those types has
a copy constructor for one of the other types? That can cause such
methods to wind up calling themselves. If it is stack overflow, my guess
is it's in a destructor somewhere. Or maybe the thread needs a larger
stack allocation. A first step would be to just print function
entrypoints to your debugger, and see if they pile up too much.

Ray
 
P

Peter

D'artagnan said:
I'm using Pthreads in a C++ program that uses exceptions. When one
thread is cancelled (cancellation state is deferred) by the main
thread, it throws some mysterious exception which cannot even be caught

by "catch(...)". The program aborts with the following error message:

FATAL: exception not rethrown
Abort


Anybody have ideas how to avoid this problem? Specifically, how to
catch the cancellation exception, or how to ignore it? Thanks a lot.


could it be that your exception class does not have a copy constructor?
 
P

Peter

D'artagnan said:
I'm using Pthreads in a C++ program that uses exceptions. When one
thread is cancelled (cancellation state is deferred) by the main
thread, it throws some mysterious exception which cannot even be caught

by "catch(...)". The program aborts with the following error message:

FATAL: exception not rethrown
Abort


Anybody have ideas how to avoid this problem? Specifically, how to
catch the cancellation exception, or how to ignore it? Thanks a lot.


could it be that your exception class does not have a copy constructor?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top