[Numpy-discussion] Proposed Roadmap Overview

Sturla Molden sturla at molden.no
Sat Feb 18 00:16:08 EST 2012



Den 18. feb. 2012 kl. 05:56 skrev Charles R Harris <charlesr.harris at gmail.com>:

> 
> 
> But won't a C++ wrapper catch that?

A try-catch block with MSVC will register an SEH with the operating system. GCC (g++) implements exceptions without SEH. What happens if GCC code tries to catch a std::bad_alloc? Windows intervenes and sends control to a registered SEH. So the flow of control jumps out of GCC's hands, and goes to some catch or __except block set by MSVC instead. And now the stack is FUBAR... But this can always happen when you mix MSVC and MinGW. Even pure C code can set an SEH with MSVC, so it's not a C++ issue. You cannot wrap in a way that protects you from an intervention by the operating system. It's better to stick with MS and Intel compilers on Windows. MinGW code must execute in an SEH free environment.

Sturla











-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120218/0e8f0a65/attachment.html>


More information about the NumPy-Discussion mailing list