Re: Core dumps building Python on AIX

Guido van Rossum <[email protected]> Wed, 14 Aug 2002 14:30:55 -0400
Newsgroups gmane.comp.python.snake-farm.user
Message-ID <[email protected]>
> > The AIX builds fail in the phase where it's building the extensions
> > using setup.py:
> ...
> > Can someone with access to the snake farm try to find out what's going
> > on here?
> 
> It dies trying to link the first dynamic module, in this case
> struct.so.
> 
> running build
> running build_ext
> building 'struct' extension
> creating build
> creating build/temp.aix-4.2-2.3
> gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/tmp_mnt/mp/slaskdisk/tmp/kalle/python/dist/src/./Include -I/usr/local/include -I/tmp_mnt/mp/slaskdisk/tmp/kalle/python/dist/src/Include -I/tmp_mnt/mp/slaskdisk/tmp/kalle/python/dist/src -c /tmp_mnt/mp/slaskdisk/tmp/kalle/python/dist/src/Modules/structmodule.c -o build/temp.aix-4.2-2.3/structmodule.o
> creating build/lib.aix-4.2-2.3
> ./Modules/ld_so_aix gcc -bI:Modules/python.exp build/temp.aix-4.2-2.3/structmodule.o -L/usr/local/lib -o build/lib.aix-4.2-2.3/struct.so
> make: *** [sharedmods] Segmentation fault (core dumped)
> 
> I would have tried my poor gdb skills on the core file if it weren't
> for the fact that we have no gdb on the platform.  I'll try to build
> one later.
> 
> > One suggestion I have is to try to rebuild without -O3.  It seems
> > Python is dumping core, and a broken optimizer is a likely cause.
> 
> No change with OPT="-g".
> 
> I uncommented the echo lines in ld_so_aix and got this:
> 
> ./Modules/ld_so_aix gcc -bI:Modules/python.exp build/temp.aix-4.2-2.3/structmodule.o -L/usr/local/lib -o build/lib.aix-4.2-2.3/struct.so
> ld_so_aix: Debug info section
>   -> output file : build/lib.aix-4.2-2.3/struct.so
>   -> import file : Modules/python.exp
>   -> export file : struct.exp
>   -> entry point : initstruct
>   -> object files:  build/temp.aix-4.2-2.3/structmodule.o
>   -> CC arguments:  build/temp.aix-4.2-2.3/structmodule.o -L/usr/local/lib
> ./Modules/makexp_aix struct.exp build/lib.aix-4.2-2.3/struct.so build/temp.aix-4.2-2.3/structmodule.o
> gcc -Wl,-einitstruct -Wl,-bE:struct.exp -Wl,-bI:Modules/python.exp -Wl,-bhalt:4 -Wl,-bM:SRE -Wl,-T512 -Wl,-H512 -lm -o build/lib.aix-4.2-2.3/struct.so build/temp.aix-4.2-2.3/structmodule.o -L/usr/local/lib
> make: *** [sharedmods] Segmentation fault (core dumped)

Hmm...  What does "file core" say?  (On Linux this tells us the name
of the program that dumps core.  It seems that it could be gcc. :-( )

I don't see a '-fPIC' option in the gcc invocation that created
structmodule.o, to create position-independent code.  Maybe you can
try again after adding this?  (If that works, we know we have to fix
configure.in to add this to CCSHARED when the platform is AIX.)

--Guido van Rossum (home page: http://www.python.org/~guido/)