Uncaught exceptions

Hi,

One of the main loops of our program looks like

void executeInstruction(){
try{
execute(…)
}catch(const IdpException& ex){

}
}

When using clang++ 3.1 to compile our project, none of the exceptions thrown in execute gets caught (which are IdpExceptions), instead the executable is terminated each time with an uncaught exception.
It still fails when adding a catch statement with ellipsis (catch(…)) to the try catch block.
Threading is not involved.

Is such behavior a known bug? It works perfectly in g++ 4.2 and beyond…

thanks in advance,
Broes

Hello

When using clang++ 3.1 to compile our project, none of the exceptions thrown
in execute gets caught (which are IdpExceptions), instead the executable is
terminated each time with an uncaught exception.

It's hard to tell until you at least specify the platform you're checking.

Hello

When using clang++ 3.1 to compile our project, none of the exceptions thrown
in execute gets caught (which are IdpExceptions), instead the executable is
terminated each time with an uncaught exception.

It’s hard to tell until you at least specify the platform you’re checking.

The platform Linux.

Some more testing showed the issue is more specific:
Given the stack
c++ code
c code
c++ code

An expection thrown by the highest block c++ code is not code by the lowest c++ block but instead goes straight into terminating the program.
(the c code is the lua library)

Broes

Hello

When using clang++ 3.1 to compile our project, none of the exceptions thrown
in execute gets caught (which are IdpExceptions), instead the executable is
terminated each time with an uncaught exception.

It’s hard to tell until you at least specify the platform you’re checking.

The platform Linux.

Please be more specific. What distribution, what version of it, and (most importantly) what architecture?

Some more testing showed the issue is more specific:
Given the stack
c++ code
c code
c++ code

An expection thrown by the highest block c++ code is not code by the lowest c++ block but instead goes straight into terminating the program.
(the c code is the lua library)

Is clang compiling the C code? The most obvious option is that we’re not compiling that code with the tables necessary to unwind through it. Does it work if you add -fexceptions or -munwind-tables to your CFLAGS?

John.

Hello

When using clang++ 3.1 to compile our project, none of the exceptions thrown
in execute gets caught (which are IdpExceptions), instead the executable is
terminated each time with an uncaught exception.

It’s hard to tell until you at least specify the platform you’re checking.

The platform Linux.

Please be more specific. What distribution, what version of it, and (most importantly) what architecture?

Ubuntu 12.04 32 bit on a 64 bit architecture.

Some more testing showed the issue is more specific:
Given the stack
c++ code
c code
c++ code

An expection thrown by the highest block c++ code is not code by the lowest c++ block but instead goes straight into terminating the program.
(the c code is the lua library)

Is clang compiling the C code? The most obvious option is that we’re not compiling that code with the tables necessary to unwind through it. Does it work if you add -fexceptions or -munwind-tables to your CFLAGS?

Clang is compiling the C code.

I have resolved my issue by compiling the intermediate library also as C++.
When I find some time, I will try the proposed compiler options.

Broes