[Python-bugs-list] dyn libs crash w/frozen exectuable (PR#155)

ecn@smart.net ecn@smart.net
Thu, 9 Dec 1999 14:28:28 -0500 (EST)


Full_Name: Eric C. Newton
Version: Python-1.5.2
OS: AIX 4.2
Submission from: ccgateip.arinc.com (144.243.4.2)


Build python on AIX, with shared modules.  Use python to freeze 
a script which uses a shared module (like string manipulation).
Run the program (it should crash).  Rename the program to "python" 
and re-run it.  It should work fine.

In aix_getoldmodules(), this line of code:

	if (strstr(ldiptr->ldinfo_filename, "python") == NULL) {

fails to do the right thing if your program isn't named "python".  So
symbols for frozen executables are not exported correctly, and the
program crashes when the first dynamic library is loaded.

Suggested fix:

	if (strstr(Py_GetProgramName(), ldiptr->ldinfo_filename) == NULL) {

This does work for me, but it might not be the right answer.

-Eric