[Pyobjc-dev] Bridging of foundation classes is a bit broken
Brought to you by:
ronaldoussoren
From: Bill B. <bb...@co...> - 2002-10-22 05:12:03
|
It seems that the bridging of the various collection classes from Python to ObjC (or back, not sure) is broken in some fashion, at the moment. I'm not sure exactly what is up. Below is a transcript of interaction with the python interpreter under gdb. Note that it doesn't not necessarily fail on a consistent number of executions of the allocator for NSMutableArray. NSMutableDictionary can cause the same crash. One might point out that I really should be using Python collections and allowing the bridge to "automatically" convert the class into a compatible container on the other side. That may be true, but this shouldn't cause the bridge to blow up entirely. b.bum [bumbox:~] bbum% gdb /usr/bin/python GNU gdb 5.1-20020408 (Apple version gdb-231) (Tue Aug 13 21:37:39 GMT 2002) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-apple-macos10". Reading symbols for shared libraries .... done (gdb) r Starting program: /usr/bin/python [Switching to process 11162 thread 0xb03] Reading symbols for shared libraries ............. done Python 2.2 (#1, 07/14/02, 23:25:09) [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. Reading symbols for shared libraries ...... done >>> from Foundation import * Reading symbols for shared libraries .......................... done Reading symbols for shared libraries . done Reading symbols for shared libraries . done >>> a = NSMutableArray.alloc().init() >>> b = NSMutableArray.array() Program received signal EXC_BAD_ACCESS, Could not access memory. 0x907aba54 in objc_msgSend () (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /usr/bin/python [Switching to process 11163 thread 0xf07] Python 2.2 (#1, 07/14/02, 23:25:09) [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from Foundation import * >>> a = NSMutableArray.array() >>> b = NSMutableArray.array() >>> c = NSMutableArray.alloc().init() >>> d = NSMutableArray.alloc().init() Program received signal EXC_BAD_ACCESS, Could not access memory. 0x907aba64 in objc_msgSend () (gdb) bt #0 0x907aba64 in objc_msgSend () #1 0x90948410 in -[NSInvocation setReturnValue:] () #2 0x9093033c in -[NSInvocation invoke] () #3 0x004654e8 in execute_and_pythonify_objc_method (aMeth=Cannot access memory at address 0x4e8 ) at Modules/objc/objc_support.m:1352 #4 0x0046d760 in objcsel_call (self=0xc5e5f0, args=0x10b870) at Modules/objc/selector.m:402 #5 0x00045930 in PyObject_Call () #6 0x0005df64 in PyEval_GetFuncDesc () #7 0x0005b32c in PyEval_EvalCode () #8 0x0005c634 in PyEval_EvalCodeEx () #9 0x00058a80 in PyEval_EvalCode () #10 0x00027e90 in PyRun_FileExFlags () #11 0x00026c70 in PyRun_InteractiveOneFlags () #12 0x00026a58 in PyRun_InteractiveLoopFlags () #13 0x000268f0 in PyRun_AnyFileExFlags () #14 0x000069f0 in Py_Main () #15 0x00002970 in start () #16 0x000027f0 in start () (gdb) |