This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: HP-UX: Can't shl_load() a library containing Thread Local
Type: behavior Stage: test needed
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: blade_doyle, georg.brandl, loewis
Priority: low Keywords:

Created on 2005-12-14 00:20 by blade_doyle, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg60849 - (view) Author: Blade (blade_doyle) Date: 2005-12-14 00:20
HP-UX runtime loader does not support dynamic load of
shared libraries that contain (TLS) thread local
storage.  As a result, when attempting to import
modules that contain TLS the following error is reported:

"/usr/lib/dld.sl: Can't shl_load() a library containing
Thread Local Storage"

This problem was discussed previously on the python.org
mail list:

http://mail.python.org/pipermail/python-list/2003-May/164024.html

There is another option:  Use LD_PRELOAD environment
variable to cuase the runtime loader to 'pre-load' the
pthreads library (and dependancies of the pthread
library).  See the dld.sl(5) man page for more info on
LD_PRELOAD.

But, I think a 5th option is ideal.  If libpthread.sl
(and the dependancies of libpthread) are linked into
the python executable at build time then all of these
problems are avoided.  I suggest that the HP-UX
(includes hp-ux on ia64) build process be modified so
that libpthead (and depends) are linked in.  Or, at
least, make a note of this problem/solution in the
HP-UX section of the README file distributed with
python source.

Here is the process I use to work around the TLS problem:

HP-UX:
bash$ BASECFLAGS="-DTHREAD_STACK_SIZE=0x50000"; export
BASECFLAGS
bash$ ./configure --without-gcc --enable-shared
--with-libs='-lpthread -lstd_v2 -lCsup_v2 -lcl'
bash$ **Edit the Makefile and remove -O from the OPT line.
bash$ make
bash$ make test
bash$ make install

HP-UX on ia64:
bash$ CC=cc; export CC
bash$ CXX=aCC; export CXX
bash$ BASECFLAGS="+DD64 -DTHREAD_STACK_SIZE=0x50000";
export BASECFLAGS
bash$ LDFLAGS="+DD64"; export LDFLAGS
bash$ ./configure --without-gcc --enable-shared
--with-libs="-lpthread -lCsup -lstd_v2 -lunwind"
bash$ unset CC
bash$ unset CXX
bash$ unset BASECFLAGS
bash$ unset LDFLAGS
bash$ **Edit the Makefile and remove -O from the OPT line.
bash$ make
bash$ make test
bash$ make install


msg60850 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-01-11 22:56
Logged In: YES 
user_id=21627

Can you provide a patch?
msg60851 - (view) Author: Blade (blade_doyle) Date: 2006-01-11 23:20
Logged In: YES 
user_id=1404264

I think so.  Please stay tuned.  I'll post the patch when I
have it ready.
msg114611 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-21 23:52
Is a patch still forthcoming?
msg185411 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-03-28 09:57
Closing this old pending issue due to lack of response.
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42690
2013-03-28 09:57:41georg.brandlsetstatus: pending -> closed

messages: + msg185411
2010-08-21 23:52:00georg.brandlsetstatus: open -> pending

nosy: + georg.brandl
messages: + msg114611

resolution: out of date
2009-03-20 23:31:03ajaksu2setpriority: normal -> low
stage: test needed
type: behavior
versions: + Python 2.6
2005-12-14 00:20:37blade_doylecreate