Bugs item #1508848, was opened at 2006-06-19 19:20 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1508848&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Extension Modules Group: Python 2.3 Status: Open Resolution: None Priority: 5 Submitted By: William Ding (dingwen_ca) Assigned to: Nobody/Anonymous (nobody) Summary: failed to load tuxedo libs Initial Comment: we have a tuxedo(BEA) python extension, the extension works very well under solaris/AIX, it has issue with HPUX(PA-RISC or ITANINM) with python 2.3.2 and 2.3.5 >>> import tuxedo # /usr1/arbor/3p/terrapin/HPUX/python/modules/tuxedo.p yc has bad mtime import tuxedo # from /usr1/arbor/3p/terrapin/HPUX/python/modules/tuxed o.py # can't create /usr1/arbor/3p/terrapin/HPUX/python/modules/tux edo.pyc # /usr1/arbor/3ppython/HPUX/lib/python2.3/re.pyc matches /usr1/arbor/3ppython/HPUX/lib/python2.3/re.py import re # precompiled from /usr1/arbor/3ppython/HPUX/lib/python2.3/re.pyc # /usr1/arbor/3ppython/HPUX/lib/python2.3/sre.pyc matches /usr1/arbor/3ppython/HPUX/lib/python2.3/sre.py import sre # precompiled from /usr1/arbor/3ppython/HPUX/lib/python2.3/sre.pyc # /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_compile. pyc matches /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_co mpile.py import sre_compile # precompiled from /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_compi le.pyc import _sre # builtin # /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_constant s.pyc matches /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_co nstants.py import sre_constants # precompiled from /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_const ants.pyc # /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_parse.py c matches /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_pa rse.py import sre_parse # precompiled from /usr1/arbor/3ppython/HPUX/lib/python2.3/sre_parse .pyc # /usr1/arbor/3ppython/HPUX/lib/python2.3/string.pyc matches /usr1/arbor/3ppython/HPUX/lib/python2.3/string .py import string # precompiled from /usr1/arbor/3ppython/HPUX/lib/python2.3/string.py c shl_load /usr1/arbor/3ppython/HPUX/lib/python2.3/lib- dynload/strop.so shl_findsym initstrop import strop # dynamically loaded from /usr1/arbor/3ppython/HPUX/lib/python2.3/lib- dynload/strop.so shl_load _tuxedowsnmodule.so /usr/lib/hpux64/dld.so: Unsatisfied code symbol '_strpresend' in load module '/usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl'. /usr/lib/hpux64/dld.so: Unsatisfied code symbol '_strencdec' in load module '/usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl'. /usr/lib/hpux64/dld.so: Unsatisfied code symbol '_sfilter' in load module '/usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl'. /usr/lib/hpux64/dld.so: Unsatisfied code symbol '_sformat' in load module '/usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl'. /usr/lib/hpux64/dld.so: Unsatisfied code symbol '_finit' in load module '/usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl'. _tuxedowsnmodule.so is our python interface lib, from 'ldd -r' output, the lib itself should not have any issue, but when we tried to load it to python, it complained, bash-3.00$ ldd _tuxedowsnmodule.so libwsc.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libwsc.sl libbuft.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl libgpnet.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libgpnet.sl libfml.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml.sl libfml32.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml32.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libpthread.so.1 => /usr/lib/hpux64/libpthread.so.1 libnsl.so.1 => /usr/lib/hpux64/libnsl.so.1 libm.so.1 => /usr/lib/hpux64/libm.so.1 libc.so.1 => /usr/lib/hpux64/libc.so.1 libbuft.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl libgpnet.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libgpnet.sl libgiconv.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libgiconv.sl libfml.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml.sl libfml32.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml32.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libxti.so.1 => /usr/lib/hpux64/libxti.so.1 libdl.so.1 => /usr/lib/hpux64/libdl.so.1 bash-3.00$ ldd -r _tuxedowsnmodule.so libwsc.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libwsc.sl libbuft.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl libgpnet.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libgpnet.sl libfml.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml.sl libfml32.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml32.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libpthread.so.1 => /usr/lib/hpux64/libpthread.so.1 libnsl.so.1 => /usr/lib/hpux64/libnsl.so.1 libm.so.1 => /usr/lib/hpux64/libm.so.1 libc.so.1 => /usr/lib/hpux64/libc.so.1 libbuft.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libbuft.sl libgpnet.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libgpnet.sl libgiconv.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libgiconv.sl libfml.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml.sl libfml32.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libfml32.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libengine.sl => /usr1/arbor/3p/tuxedo/HPUX/lib/libengine.sl libxti.so.1 => /usr/lib/hpux64/libxti.so.1 libdl.so.1 => /usr/lib/hpux64/libdl.so.1 symbol not found: Py_InitModule4 (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyModule_GetDict (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyExc_IOError (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyString_AsString (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyFloat_FromDouble (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyEval_SaveThread (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyObject_Malloc (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyErr_SetObject (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyErr_Occurred (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyObject_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyFloat_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyExc_TypeError (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyInt_FromLong (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyEval_RestoreThread (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyObject_GetAttrString (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyInt_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyCObject_AsVoidPtr (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyType_IsSubtype (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyString_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyTuple_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyInt_AsLong (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyString_Size (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyObject_CallFunction (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyObject_Init (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyObject_CallMethod (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyFile_AsFile (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyArg_ParseTuple (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyImport_ImportModule (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyErr_NewException (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyString_FromString (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyDict_GetItemString (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyDict_SetItemString (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyFloat_AsDouble (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyType_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: Py_FindMethod (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyFile_Type (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyString_FromStringAndSize (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyCObject_FromVoidPtr (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: PyErr_SetString (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: _Py_NoneStruct (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: Py_BuildValue (/usr1/arbor/3p/terrapin/HPUX/lib/_tuxedowsnmodule.so) symbol not found: main (/usr1/arbor/3p/tuxedo/HPUX/lib/libfml.sl) symbol not found: main (/usr1/arbor/3p/tuxedo/HPUX/lib/libfml32.sl) symbol not found: main (/usr/lib/hpux64/libc.so.1) we looked at the python source code, and think we found the cause of the issue: case $ac_sys_system/$ac_sys_release in AIX*) DYNLOADFILE="dynload_aix.o";; BeOS*) DYNLOADFILE="dynload_beos.o";; hp*|HP*) DYNLOADFILE="dynload_hpux.o";; Darwin/*) DYNLOADFILE="dynload_next.o";; atheos*) DYNLOADFILE="dynload_atheos.o";; *) # use dynload_shlib.c and dlopen() if we have it; otherwise stub # out any dynamic loading if test "$ac_cv_func_dlopen" = yes then DYNLOADFILE="dynload_shlib.o" else DYNLOADFILE="dynload_stub.o" fi where on hpux the file dynload_hpux is used. Looking inside Python/dynload_hpux.c; flags = BIND_FIRST | BIND_DEFERRED; if (Py_VerboseFlag) { flags = BIND_FIRST | BIND_IMMEDIATE | BIND_NONFATAL | BIND_VERBOSE; printf("shl_load %s\n",pathname); } lib = shl_load(pathname, flags, 0); /* XXX Chuck Blake once wrote that 0 should be BIND_NOSTART? */ if (lib == NULL) { char buf[256]; if (Py_VerboseFlag) perror(pathname); PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s", pathname); PyErr_SetString(PyExc_ImportError, buf); return NULL; } We looked through the shl_load man page and found that Python should be using the option BIND_TOGETHER. I tried it and it loads the tuxedo module. shl_load man page; BIND_TOGETHER When used with BIND_FIRST, the library being mapped and its dependent libraries will be bound together. This is the default behavior for all shl_load() requests not using BIND_FIRST. So we changed the /Python- 2.3.2/Python/dynaload_hpux.c to; flags = BIND_FIRST | BIND_DEFERRED | BIND_TOGETHER; if (Py_VerboseFlag) { flags = BIND_FIRST | BIND_IMMEDIATE | BIND_TOGETHER | BIND_NONFATAL | BIND_VERBOSE; printf("shl_load %s\n",pathname); } Not sure if there is version of python without the bug, and if it is possible to patch 2.3.2 and 2.3.5 OS tested: B.11.23 U 9000/800 (PA-RISC and ITANIUM) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1508848&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com