[Pythonmac-SIG] What is a bus error, anyway?

Jack Jansen Jack.Jansen@oratrix.com
Wed, 17 Jul 2002 23:26:20 +0200


There are two problems with your installation.

The first one, but this isn't the cause of your problems, is 
that you've linked /usr/local/bin/python to the Python.app 
executable. This is a bad idea as all Python scripts will now 
use Python.app (which you can distinguish from the "normal" 
python because it has "Pythonw 2.3a0" in its banner in stead of 
"Python 2.3a0".

The second problem is that a symlink to the executable inside a 
.app will not work. You *must* start the executable inside the 
app with a full pathname. We discovered this the hard way a few 
months ago, and since then we no longer put a symlink "pythonw" 
in /usr/local/bin but in stead a shell script. If you are 
working from current CVS then the Makefile in Mac/OSX knows how 
to set things up correctly.

And, in case you're interested, the reason the symlink doesn't 
work is because somewhere early in startup the executable inside 
the .app will try to find it's bundle. It does so by looking at 
argv[0], apparently. argv[0] will be the symlink 
(/usr/local/bin/python), not the path that the symlink points 
to. Then, something gets very confused and scribbles over memory.

Don't blame me, I didn't write it:-)

On woensdag, juli 17, 2002, at 10:03 , Frans H. Schippers wrote:
> Although i don't understand what is happening i do the 
> following things:
>
> localhost% ls -l /usr/local/bin/python
> lrwxrwxrwx  1 ronald  staff  46 Jun 21 15:50 
> /usr/local/bin/python -> 
> /Applications/Python.app/Contents/MacOS/python
>
> localhost% ls -l /Applications/Python.app/Contents/MacOS/python
> -rwxr-xr-x  1 frans  admin  19576 Jul 12 16:01 
> /Applications/Python.app/Contents/MacOS/python
>
> localhost% python
> Pythonw 2.3a0 (#1, Jul 12 2002, 13:20:46)
> [GCC 2.95.2 19991024 (release)] on darwin
> Type "copyright", "credits" or "license" for more information.
>>>>
>
> Now in an other terminal window (same user frans)
> localhost% python
> zsh: bus error  python
>
> Now in yet an other terminal window  (same user frans)
> localhost% /Applications/Python.app/Contents/MacOS/python
> Pythonw 2.3a0 (#1, Jul 12 2002, 13:20:46)
> [GCC 2.95.2 19991024 (release)] on darwin
> Type "copyright", "credits" or "license" for more information.
>>>>
>
> So if i invoke python twice though the symbolic link it results 
> in bus errors.
>
> Hope you can explain it.
>
> Frans
> --
> X|support bv             mailto:xsupport@inter.nl.net
>
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -