[Pythonmac-SIG] re: Interpreting a crash dump

Jack Jansen Jack.Jansen at cwi.nl
Sat Feb 21 07:13:43 EST 2004


On 21 Feb 2004, at 10:28, Robin Becker wrote:

> I was able to solve the problem of mismatched strncpy in my dylib
> embedded python application by the following strategy.
>
>
> 1) Switch from -flat_namespace to -twolevel_namespace
> 2) Fix up a missing external _environ by using my own version.
> 3) Ensure the client was prepared for the double definition of 
> _environ.
>
> It seems environ is normally supplied by crt1 (ie the main startup). 
> How
> do other macpythoneers get round the problem (ie python internals refer
> to _environ). The linker seems unable to do a mixed strategy ie link
> evrything twolevel except for specified externals.

Same strategy: provide your own _environ. The code is somewhere in
posixmodule.c.

As to the mixed strategy: Mach-O cannot really do this, there is no way 
to
define references back from a shared library to the hosting program. On 
most
unixen the distinction between shared libraries and plugins doesn't 
exist,
so that probably takes care of the situation.

Hmm, no, on second thoughts that isn't the complete story. I don't know 
why
Apple aren't storing _environ in libc. (or libSystem.dylib, or 
whatever).
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Pythonmac-SIG mailing list