public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Exception handling problems with MinGW64 GCC 4.8.0 with SEH
@ 2013-03-26 14:49 Martin Corino
  2013-03-26 16:06 ` Tobias Burnus
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Corino @ 2013-03-26 14:49 UTC (permalink / raw)
  To: gcc-help

Hi,

We've found a problem with the 64bit MinGW64 win32-seh build of the
GCC-4.8.0 compilers we downloaded from the mingwbuilds site.

We're building a quite extensive cross-platform C++ framework which
implements a lot of separate functionalities in shared libraries/DLLs
and which also extensively uses exceptions.

What we found is that with the win32-seh versions of the compiler we
were not able to catch an exception thrown from within one of the
framework DLLs in the application code using that DLL. I.e. the
following did not work:

<pre>
try {
 ... // some code calling methods exported from  DLL
}
catch (const <fully scoped exception typename>& ex) {
 ...
}
</pre>

Catching with a catch-all construct ('catch (...)') however did work.

This is code which works flawlessly on Linux as well as with the MinGW32
GCC 4.6.2 compiler.
As it turns out it also works with the MinGW64 GCC 4.8.0 win32-sjlj
version of the compilers from mingwbuilds (both for 32bit as well as for
64bit).

Is this a known problem we missed mentioned somewhere?

regards,
Martin Corino.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Exception handling problems with MinGW64 GCC 4.8.0 with SEH
  2013-03-26 14:49 Exception handling problems with MinGW64 GCC 4.8.0 with SEH Martin Corino
@ 2013-03-26 16:06 ` Tobias Burnus
  2013-03-26 17:57   ` Martin Corino
  0 siblings, 1 reply; 3+ messages in thread
From: Tobias Burnus @ 2013-03-26 16:06 UTC (permalink / raw)
  To: Martin Corino; +Cc: gcc-help

Hi,

Martin Corino wrote:
> What we found is that with the win32-seh versions of the compiler we
> were not able to catch an exception thrown from within one of the
> framework DLLs in the application code using that DLL. I.e. the
> following did not work:

That's a known problem - but, unfortunately, no solution has been found, 
yet.

See also the following problem report 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56742

(If you wonder why you didn't see that PR before: Kai has just filled 
it, motivated by your email, to make tracking of the issue simpler.)

At least for the test case in the PR, the program works when compiled 
with -O1 and only fails with higher optimization levels. I don't know 
whether that would be an option for you.

Tobias

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Exception handling problems with MinGW64 GCC 4.8.0 with SEH
  2013-03-26 16:06 ` Tobias Burnus
@ 2013-03-26 17:57   ` Martin Corino
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Corino @ 2013-03-26 17:57 UTC (permalink / raw)
  To: Tobias Burnus; +Cc: gcc-help

Thanks for the info Tobias.
Good to know the issue is noted.

In our case we'll just stick with the (working) sjlj compilers.
We're more interested in working exception handling functionality than a
better performing implementation thereof (although we'll gladly move to
seh when ready).

Martin.

On 03/26/2013 05:06 PM, Tobias Burnus wrote:
> Hi,
> 
> Martin Corino wrote:
>> What we found is that with the win32-seh versions of the compiler we
>> were not able to catch an exception thrown from within one of the
>> framework DLLs in the application code using that DLL. I.e. the
>> following did not work:
> 
> That's a known problem - but, unfortunately, no solution has been found,
> yet.
> 
> See also the following problem report
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56742
> 
> (If you wonder why you didn't see that PR before: Kai has just filled
> it, motivated by your email, to make tracking of the issue simpler.)
> 
> At least for the test case in the PR, the program works when compiled
> with -O1 and only fails with higher optimization levels. I don't know
> whether that would be an option for you.
> 
> Tobias
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-26 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-26 14:49 Exception handling problems with MinGW64 GCC 4.8.0 with SEH Martin Corino
2013-03-26 16:06 ` Tobias Burnus
2013-03-26 17:57   ` Martin Corino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).