From: SourceForge.net <no...@so...> - 2007-10-16 22:27:40
|
Bugs item #1814532, was opened at 2007-10-16 16:17 Message generated for change (Comment added) made by olly You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1814532&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: python Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Joseph Winston (josephwinston) Assigned to: Marcelo Matus (marcelomatus) Summary: threads and directors fail in svn head (9990) Initial Comment: When the attached interface uses threads in svn head with Python 2.4.4 on a Linux system (eg %module(package="example", directors="1", threads="1") example) gdb reports: gdb python GNU gdb 6.7 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /net/sorry.s/jody/Tools/x86_64-unknown-linux/bin/python [Thread debugging using libthread_db enabled] [New Thread 0x2b95a2f11b00 (LWP 11865)] Python 2.4.4 (#6, Oct 16 2007, 09:54:00) [GCC 4.1.1 (Gentoo 4.1.1-r3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import runme <example.SpObject; proxy of <Swig Object of type 'SpObject *' at 0x6fb100> > 42 <example.SpObject; proxy of <Swig Object of type 'SpObject *' at 0x6fe750> > 42 Program received signal SIGINT, Interrupt. [Switching to Thread 0x2b95a2f11b00 (LWP 11865)] 0x00002b95a255c20d in sem_wait () from /lib/libpthread.so.0 (gdb) where #0 0x00002b95a255c20d in sem_wait () from /lib/libpthread.so.0 #1 0x000000000049d25d in PyThread_acquire_lock (lock=0x6f6450, waitflag=1) at Python/thread_pthread.h:313 #2 0x00002b95a33e2905 in Guard (this=0x7fffffcfff80, mutex=@0x2b95a34e94c0) at example_wrap.cxx:2820 #3 0x00002b95a33e29c3 in Swig::Director::swig_release_ownership (this=0x718a68, vptr=0x718a60) at example_wrap.cxx:2931 #4 0x00002b95a33dd25c in _wrap_SpDoubleList_get (args=0x2b95a2fed410) at example_wrap.cxx:4048 #5 0x0000000000413a70 in PyObject_Call (func=0x6f6450, arg=0x0, kw=0x0) at Objects/abstract.c:1795 #6 0x0000000000472451 in PyEval_EvalFrame (f=0x663180) at Python/ceval.c:3845 #7 0x000000000047517c in PyEval_EvalCodeEx (co=0x2b95a2fee500, globals=<value optimized out>, locals=<value optimized out>, args=0x6cea68, argcount=1, kws=0x6cea70, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2741 #8 0x0000000000472d2a in PyEval_EvalFrame (f=0x6ce8e0) at Python/ceval.c:3661 #9 0x000000000047517c in PyEval_EvalCodeEx (co=0x2b95a2fe5490, globals=<value optimized out>, locals=<value optimized out>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2741 #10 0x00000000004752a2 in PyEval_EvalCode (co=0x6f6450, globals=0x0, locals=0x0) at Python/ceval.c:484 #11 0x000000000048f127 in PyImport_ExecCodeModuleEx (name=0x7fffffd02720 "runme", co=0x2b95a2fe5490, pathname=0x7fffffd00610 "runme.pyc") at Python/import.c:636 #12 0x000000000048f758 in load_source_module (name=0x7fffffd02720 "runme", pathname=0x7fffffd00610 "runme.pyc", fp=<value optimized out>) at Python/import.c:915 #13 0x0000000000490252 in import_submodule (mod=0x5f8300, subname=0x7fffffd02720 "runme", fullname=0x7fffffd02720 "runme") at Python/import.c:2276 #14 0x00000000004906d4 in load_next (mod=0x5f8300, altmod=0x5f8300, p_name=<value optimized out>, buf=0x7fffffd02720 "runme", p_buflen=0x7fffffd0373c) at Python/import.c:2096 #15 0x0000000000490902 in PyImport_ImportModuleEx (name=0x2b95a2497270 "\003", globals=0x2b95a2497294, locals=<value optimized out>, fromlist=0x5f8300) at Python/import.c:1931 #16 0x000000000046a7d1 in builtin___import__ (self=<value optimized out>, args=<value optimized out>) at Python/bltinmodule.c:45 #17 0x0000000000413a70 in PyObject_Call (func=0x6f6450, arg=0x0, kw=0x0) at Objects/abstract.c:1795 #18 0x000000000046e4e0 in PyEval_CallObjectWithKeywords (func=0x2b95a2484440, arg=0x2b95a247df18, kw=0x0) at Python/ceval.c:3435 #19 0x00000000004715aa in PyEval_EvalFrame (f=0x627560) at Python/ceval.c:2020 #20 0x000000000047517c in PyEval_EvalCodeEx (co=0x2b95a2fd8f80, globals=<value optimized out>, locals=<value optimized out>, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2741 #21 0x00000000004752a2 in PyEval_EvalCode (co=0x6f6450, globals=0x0, locals=0x0) at Python/ceval.c:484 #22 0x00000000004988a0 in PyRun_InteractiveOneFlags (fp=<value optimized out>, filename=0x4c1e29 "<stdin>", flags=0x7fffffd03c50) at Python/pythonrun.c:1285 #23 0x00000000004989a4 in PyRun_InteractiveLoopFlags (fp=0x2b95a2f0b680, filename=0x4c1e29 "<stdin>", flags=0x7fffffd03c50) at Python/pythonrun.c:704 #24 0x000000000049941a in PyRun_AnyFileExFlags (fp=0x2b95a2f0b680, filename=0x4c1e29 "<stdin>", closeit=0, flags=0x7fffffd03c50) at Python/pythonrun.c:667 #25 0x0000000000410acf in Py_Main (argc=<value optimized out>, argv=0x7fffffd067ef) at Modules/main.c:493 #26 0x00002b95a2cf3374 in __libc_start_main () from /lib/libc.so.6 #27 0x000000000040ffa9 in _start () (gdb) If the interface is changed to not use threads (eg %module(package="example", directors="1") example), the supplied code appears to work. This example works correctly in 1.3.31 and from the attached diffs (gdb.txt) it seems that the only real changes are in the way python uses threads. ---------------------------------------------------------------------- >Comment By: Olly Betts (olly) Date: 2007-10-16 23:27 Message: Logged In: YES user_id=14972 Originator: NO It seems likely to be related. I'll have a look. ---------------------------------------------------------------------- Comment By: William Fulton (wsfulton) Date: 2007-10-16 21:57 Message: Logged In: YES user_id=242951 Originator: NO Olly, is this perhaps something to do with revision 9806 in directors.swg you added? Joseph, you might try reverting the patch and seeing if it starts to work again. Revision 9806 - (view) (download) (annotate) - [select for diffs] Modified Sat May 12 13:55:19 2007 UTC (5 months ago) by olly File length: 10934 byte(s) Diff to previous 9727 swig -python -threads now generates C/C++ code which uses Python's own threading abstraction (from pythread.h) rather than OS specific code. The old code failed to compile on MS Windows. (See SF patch tracker #1710341). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101645&aid=1814532&group_id=1645 |