Dynamic loading of modules in AIX

Neal Norwitz neal at metaslash.com
Sat Nov 9 10:11:52 EST 2002


On Fri, 08 Nov 2002 01:13:03 -0500, Stuart D. Gathman wrote:

> On Thu, 07 Nov 2002 22:04:23 -0500, Neal Norwitz wrote:
> 
>> I'm trying to get python to load dynamic modules. But after loading the
>> module, when code inside the module calls back into the main program,
>> it seg faults.  More details below.
> 
> You need to use ld_so_aix, which imports the symbols for the main
> program into the loadable modules.  Otherwise, those symbols are
> unresolved giving a coredump when called.

Stuart, thanks for your reply.  Actually, it is using ld_so_aix.  
I cut it out for brevity.  Sorry for the confusion.

I am using the standard make process. ./configure && make

> You can find my RPM spec file for python-2.2 at
> http://www.bmsi.com/aix/python-2.2.spec
> 
> (along with binary RPMs and a tar of rpm itself.  RPM needs LANG=C on
> some AIX versions.)
> 
> Even if you don't use RPM on AIX, the spec file will tell you how to
> build python.  Look at the %build section.
 
I looked at your spec file.  I tried setting LANG=C.  It didn't help.
I tried using xlc and -brtl -bdynamic.  That also didn't help.
I noticed that gcc was compiled with --disabled-shared.  I don't know
if that's a problem.  I suspect not, since xlc also fails.

The python.exp file appears to be created correctly.  The API which
causes the core dump is in python.exp file.  This file is imported
when trying to make the .so.

I'm not sure how the machines are configured.  So it's possible there's
a configuration problem.  I checked my limits (ulimit) and those seemed
fine.

Any other ideas?

Thanks,
Neal



More information about the Python-list mailing list