GNOME Bugzilla – Bug 422624
import CORBA or ORBit 2.14.1 crashes python on MacOSX (10.4)
Last modified: 2007-03-28 19:15:05 UTC
Steps to reproduce: 1. import CORBA / ORBit 2. 3. Stack trace: ********** Host Name: Bilbo Date/Time: 2007-03-25 08:59:41.688 -0400 OS Version: 10.4.9 (Build 8P135) Report Version: 4 Command: python Path: /opt/local/bin/python Parent: bash [29651] Version: ??? (???) PID: 29659 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000008 Thread 0 Crashed: 0 org.python.python 0x00267584 mro_implementation + 228 (typeobject.c:986) 1 org.python.python 0x0020e0c4 PyObject_Call + 52 (abstract.c:1796) 2 org.python.python 0x00291970 PyEval_CallObjectWithKeywords + 272 (ceval.c:3431) 3 libpython2.4.dylib 0x013c66e4 mro_internal + 100 (typeobject.c:1304) 4 libpython2.4.dylib 0x013c479c PyType_Ready + 1692 (typeobject.c:3204) 5 libpython2.4.dylib 0x013c4184 PyType_Ready + 132 (typeobject.c:3156) 6 ORBit.so 0x00573f34 initORBit + 1156 (ORBitmodule.c:437) 7 org.python.python 0x002bb1e4 _PyImport_LoadDynamicModule + 196 (importdl.c:54) 8 org.python.python 0x002b9638 import_submodule + 424 (import.c:2267) 9 org.python.python 0x002b98b0 load_next + 288 (import.c:2087) 10 org.python.python 0x002b9f54 PyImport_ImportModuleEx + 532 (import.c:1922) 11 org.python.python 0x00287ec8 builtin___import__ + 104 (bltinmodule.c:45) 12 org.python.python 0x0020e0c4 PyObject_Call + 52 (abstract.c:1796) 13 org.python.python 0x00291970 PyEval_CallObjectWithKeywords + 272 (ceval.c:3431) 14 org.python.python 0x0029637c PyEval_EvalFrame + 14060 (ceval.c:2020) 15 org.python.python 0x002992d4 PyEval_EvalCodeEx + 2196 (ceval.c:2736) 16 org.python.python 0x00299480 PyEval_EvalCode + 48 (ceval.c:490) 17 org.python.python 0x002b8070 PyImport_ExecCodeModuleEx + 304 (import.c:632) 18 org.python.python 0x002b8570 load_source_module + 1008 (import.c:910) 19 org.python.python 0x002b9638 import_submodule + 424 (import.c:2267) 20 org.python.python 0x002b98b0 load_next + 288 (import.c:2087) 21 org.python.python 0x002b9f54 PyImport_ImportModuleEx + 532 (import.c:1922) 22 org.python.python 0x00287ec8 builtin___import__ + 104 (bltinmodule.c:45) 23 org.python.python 0x0020e0c4 PyObject_Call + 52 (abstract.c:1796) 24 org.python.python 0x00291970 PyEval_CallObjectWithKeywords + 272 (ceval.c:3431) 25 org.python.python 0x0029637c PyEval_EvalFrame + 14060 (ceval.c:2020) 26 org.python.python 0x002992d4 PyEval_EvalCodeEx + 2196 (ceval.c:2736) 27 org.python.python 0x00299480 PyEval_EvalCode + 48 (ceval.c:490) 28 org.python.python 0x002c3928 PyRun_InteractiveOneFlags + 584 (pythonrun.c:1266) 29 org.python.python 0x002c3b20 PyRun_InteractiveLoopFlags + 288 (pythonrun.c:699) 30 org.python.python 0x002c4910 PyRun_AnyFileExFlags + 176 (pythonrun.c:659) 31 org.python.python 0x002cfb38 Py_Main + 2744 (main.c:493) 32 python 0x000028ec _start + 760 33 python 0x000025f0 start + 48 Thread 0 crashed with PPC Thread State 64: srr0: 0x0000000000267584 srr1: 0x000000000200f030 vrsave: 0x0000000000000000 cr: 0x48242222 xer: 0x0000000000000004 lr: 0x0000000000267578 ctr: 0x0000000090003ab8 r0: 0x0000000000267578 r1: 0x00000000bfffd570 r2: 0x000000000000002b r3: 0x0000000000000000 r4: 0x0000000000000000 r5: 0x0000000000000000 r6: 0x0000000000000001 r7: 0x0000000000000006 r8: 0x0000000000000006 r9: 0x0000000000608fd0 r10: 0x000000000070011f r11: 0x0000000000000000 r12: 0x0000000090003ab8 r13: 0x00000000ffffffff r14: 0x0000000000000000 r15: 0x00000000ffffffff r16: 0x0000000000057bc4 r17: 0x0000000000056c70 r18: 0x0000000000056c30 r19: 0x0000000000000000 r20: 0x00000000003074b4 r21: 0x0000000001463f6c r22: 0x0000000000057a08 r23: 0x000000000005a1b0 r24: 0x0000000000000001 r25: 0x000000000005a1b0 r26: 0x0000000000000000 r27: 0x000000000146404c r28: 0x000000000005b3c8 r29: 0x0000000000057b98 r30: 0x00000000014695ac r31: 0x00000000002674b4 Binary Images Description: 0x1000 - 0x3fff python /opt/local/bin/python 0x46000 - 0x47fff libgmodule-2.0.0.dylib /opt/local/lib/libgmodule-2.0.0.dylib 0xc4000 - 0xcafff libORBit-imodule-2.0.dylib /opt/local/lib/libORBit-imodule-2.0.dylib 0xde000 - 0xe0fff libgthread-2.0.0.dylib /opt/local/lib/libgthread-2.0.0.dylib 0x205000 - 0x302fff org.python.python 2.4a0 (2.2) /opt/local/Library/Frameworks/Python.framework/Versions/2.4/Python 0x572000 - 0x582fff ORBit.so /opt/local/lib/python2.4/site-packages/ORBit.so 0x5ca000 - 0x5f5fff libIDL-2.0.dylib /opt/local/lib/libIDL-2.0.dylib 0x705000 - 0x745fff libgobject-2.0.0.dylib /opt/local/lib/libgobject-2.0.0.dylib 0x756000 - 0x75efff libintl.8.dylib /opt/local/lib/libintl.8.dylib 0x1008000 - 0x103efff libORBit-2.0.dylib /opt/local/lib/libORBit-2.0.dylib 0x114b000 - 0x11fefff libglib-2.0.0.dylib /opt/local/lib/libglib-2.0.0.dylib 0x1219000 - 0x1312fff libiconv.2.dylib /opt/local/lib/libiconv.2.dylib 0x1363000 - 0x145ffff libpython2.4.dylib /opt/local/lib/libpython2.4.dylib 0x8fe00000 - 0x8fe52fff dyld 46.12 /usr/lib/dyld 0x90000000 - 0x901bdfff libSystem.B.dylib /usr/lib/libSystem.B.dylib 0x90215000 - 0x9021afff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib 0x907bc000 - 0x90895fff com.apple.CoreFoundation 6.4.7 (368.28) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x908e0000 - 0x909e2fff libicucore.A.dylib /usr/lib/libicucore.A.dylib 0x90a3c000 - 0x90ac0fff libobjc.A.dylib /usr/lib/libobjc.A.dylib 0x90b70000 - 0x90b82fff libauto.dylib /usr/lib/libauto.dylib 0x91426000 - 0x91431fff libgcc_s.1.dylib /usr/lib/libgcc_s.1.dylib 0x94bad000 - 0x94c1efff libstdc++.6.dylib /usr/lib/libstdc++.6.dylib 0x95019000 - 0x95036fff libresolv.9.dylib /usr/lib/libresolv.9.dylib Other information: python crashes with a bus error py-orbit 2.13.1 works OK using python 2.4.3 similar to http://bugzilla.gnome.org/show_bug.cgi?id=417004
A little (big) precision : 2.14.0 works fine crashes and bus errors begin with 2.14.1 thanks
Could you please attach config.log from the pyorbit build tree?
Created attachment 85269 [details] config.log for 2.14.0
Created attachment 85271 [details] config.log for 2.14.1 This version also has a problem with python LDFLAGS but this particular problem is fixed in 2.14.2
If you comment out line 436 (PyCORBA_Enum_Type.tp_base = &PyInt_Type;) in src/ORBitmodule.c, does it then crash in a different place? I don't get it; just about the only thing that changed was that 2.14.[12] links with libpython, while 2.14.0 doesn't... Could you also get me the output of "ldd /opt/local/bin/python" ?
OK let's have a look at python linking first. configure : 18850/18851 : py_prefix=`$PYTHON -c "import sys; print sys.prefix"` gives : /opt/local/Library/Frameworks/Python.framework/Versions/2.4 afterwards, ${py_prefix}/lib is used to determine the -L flag. However, there is no libpython in sys.prefix/lib The fix is quite simple : I add a -L/opt/local/lib (where libpython reallly is) but could it cause other problems ? As I previously said, this does not happen in 2.4.2 as configure rather use sysconfig.get_config_var('LIBDIR')
Here now what happens with line 436 of src/ORBitmodule.c commented out : >>> import CORBA ** ERROR **: file pyorbit-utils.c: line 39 (_pyorbit_escape_name): assertion failed: (keyword_mod != NULL) aborting... Abort trap (same with ORBit) I don't have ldd, but it looks a lot like otool : /opt/local/lib/libpython2.4.3.dylib: /opt/local/lib/libpython2.4.dylib (compatibility version 2.4.0, current version 2.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.6) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /opt/local/lib/python2.4/site-packages/ORBit.so: /opt/local/lib/libORBit-imodule-2.0.dylib (compatibility version 1.0.0, current version 1.0.0) /opt/local/lib/libORBit-2.0.dylib (compatibility version 2.0.0, current version 2.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.8) /opt/local/lib/libIDL-2.0.dylib (compatibility version 1.0.0, current version 1.0.0) /opt/local/lib/libgmodule-2.0.0.dylib (compatibility version 1201.0.0, current version 1201.11.0) /opt/local/lib/libgthread-2.0.0.dylib (compatibility version 1201.0.0, current version 1201.11.0) /opt/local/lib/libgobject-2.0.0.dylib (compatibility version 1201.0.0, current version 1201.11.0) /opt/local/lib/libglib-2.0.0.dylib (compatibility version 1201.0.0, current version 1201.11.0) /opt/local/lib/libintl.8.dylib (compatibility version 9.0.0, current version 9.1.0) /opt/local/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0) /opt/local/lib/libpython2.4.dylib (compatibility version 2.4.0, current version 2.4.0)
(In reply to comment #6) > let's have a look at python linking first. Nope, if this is fixed in 2.4.2 then let's forget it. (In reply to comment #7) > Here now what happens with line 436 of src/ORBitmodule.c commented out : > > >>> import CORBA > > ** ERROR **: file pyorbit-utils.c: line 39 (_pyorbit_escape_name): assertion > failed: (keyword_mod != NULL) So it is triggering this assertion: keyword_mod = PyImport_ImportModule("keyword"); g_assert(keyword_mod != NULL); Something is really fundamentally broken about the python runtime here if it can't even import a simple module :| > aborting... > Abort trap > > (same with ORBit) > > > I don't have ldd, but it looks a lot like otool : > > /opt/local/lib/libpython2.4.3.dylib: > /opt/local/lib/libpython2.4.dylib (compatibility version 2.4.0, current version 2.4.0) [...] > /opt/local/lib/python2.4/site-packages/ORBit.so: [...] > /opt/local/lib/libpython2.4.dylib (compatibility version 2.4.0, current version 2.4.0) OK, I wanted to just check that the interpreter and ORBit module were both linking to same python shared library. Looks like they are, so that is not the problem. OK, can you make a simple experiment? Just build pyorbit 2.4.2 with the command 'make PYTHON_LDFLAGS= PYTHON_LIBS='. This inhibits linking with the python library. Then, after make install, if the module starts working then we can be sure that linking with libpython is causing the problem. And I can start cursing MacOSX, of course.. ;-)
Yes, now it works like a $#@?%%&* charm. Let me just see if using python 2.5 changes anything thanks
py-orbit won't compile with python2.5 undefined symbol : _environ
/me curses Darwin. OK, I don't understand why linking with libpython is failing on Darwin, but in any case I've disabled the linking for this particular platform, which should fix the build.
Yay, this fixes the problem I was seeing. Looks it may reveal or create others, but for now, I'm happy. Thanks for getting into this.