From: SourceForge.net <no...@so...> - 2010-04-07 05:44:47
|
Patches item #2818499, was opened at 2009-07-08 11:53 Message generated for change (Comment added) made by wsfulton You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=301645&aid=2818499&group_id=1645 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Solal Jacob (vertrex) Assigned to: Olly Betts (olly) Summary: [Python] Thread & Exceptions Initial Comment: SWIG 1.3.38 Segfault sometime happen in exceptions when I use swig with python c++ and -threads. I fix this enclosing %typemap(throws,noblock=1) SWIGTYPE with SWIG_PYTHON_THREAD_BEGIN_BLOCK/END_BLOCK in typemaps/swigtype.swg exception handling. ---------------------------------------------------------------------- >Comment By: William Fulton (wsfulton) Date: 2010-04-07 05:44 Message: There was some discussion of this bug with more patches on swig-devel titled "SWIG wrapped C++ method that throw exceptions causes Python to segfault when 'thread' mode is enabled" 15 Dec 2009. ---------------------------------------------------------------------- Comment By: Solal Jacob (vertrex) Date: 2009-07-30 14:55 Message: I don't have a simple test case but maybe I can made a complex one ;) In fact we're developping a framework who will be release next week (or few times later) who uses swig intensively. Our api is made of different swig module and one is for exceptions, we also load some cpp modules that aren't wrapped with swig, when we throw an exceptions from that modules that are load with dlopen it arrives some time that it segfaut, in fact I launch serveral times the modules and from times to times it segfault (so it's certainly a threading lock problems). So i will try to make a small testcase with the exceptions lib, the loader lib and a modules who throw an exceptions if it can help. Thank you very much ! ---------------------------------------------------------------------- Comment By: Olly Betts (olly) Date: 2009-07-30 03:13 Message: Thanks fo the patch. I can't apply this as-is, since it adds Python-specific macros in a generic file, so it will break all the other backends, but it shows what you did. Looking at what gets called, some is already protected by SWIG_PYTHON_THREAD_BEGIN_BLOCK, but not everything. It would be good not to have a pointless nested lock here, but that needs a bit of refactoring. Do you have a simple testcase? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=301645&aid=2818499&group_id=1645 |