[Pythonmac-SIG] GUSI (background question)

Jack Jansen jack@oratrix.nl
Thu, 20 Jan 2000 23:08:14 +0100


Recently, chriss@dnastar.com said:
> 
> I've also been woring on MacPython/GUSI2 but somehow introduced a crash
> on exit that
> I've never benn able to track down. (But why would you ever quit python)

Some GUSI data structures are freed twice, it seems. Turning off the
malloc-debug switch during Python compilation will mask the problem
(MacPython is usually compiled with malloc debug, which fills free()d
blocks with 0x2a (42 in decimal:-) so that accessing memory after
you've freed it will result in quick death (and detection).

I'll check my changes into CVS, but so far I've only adapted
PythonStandSmall. I'm stil undecided on how to do thread support for
the "real" shared Python, because if you want to import a dynamically
loaded module it has to be compiled the same way
(threading/non-threading) as the core.

So, you can again give your feedback on the following choices, or come 
up with something else:
- Make threaded the only option, that is, from the next release on
extension modules, etc. will assume threading is on.
- Make threading optional, and differentiate through the core shared
library name: PythonCore for non-threaded, PythonThreadedCore for
threaded. This may however result in problems if you have both on your 
system.
- Make threading optional and somehow distinguish between a threaded
and non-threaded PythonCore through a magic symbol exported, or the
PY_API_VERSION flag, or some such.
- Don't worry about incompatability, so modules compiled for the wrong 
model will cause spectacular crashes upon import:-)
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm