[Orbit-python-list] Re: [Python-Help] importdl.c and RTLD_GLOBAL for dlopen (fwd)
Status: Inactive
Brought to you by:
tack
From: Christian R. R. <ki...@as...> - 2000-12-05 20:48:34
|
I've exchanged a couple of emails with Martin here who points out my patch solution isn't ideal (though it Works For Me (TM)): Take care, -- /\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil ~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311 ---------- Forwarded message ---------- Date: Tue, 5 Dec 2000 12:18:24 +0100 (MET) From: Martin von Loewis <lo...@in...> Reply-To: he...@py... To: ki...@as... Cc: pyt...@py... Subject: Re: [Python-Help] importdl.c and RTLD_GLOBAL for dlopen > a) Why was the change reverted? It had been causing problems if two extension modules would define the same symbol with a different meaning. In a specific case, an Oracle module used a symbol named "initsocket". Unfortunately, the dynamic linker would resolve that as the symbol from the socket module, so the application crashed. If different extension modules can't exchange symbols, you don't get this problem. > Is the policy for 2.0 the same? Yes, it is. > Redhat supplies a patched version by default that includes > RTLD_GLOBAL. They should not do this. Do you know who at Redhat is responsible for packaging Python? > b) Is there a suggested workaround for this issue? Yes. The suggested work-around is to create a table of function pointers and put that in a PyCObject. Export that object under a well-known name in one module, and import it in the other. See cStringIO.c or ucnhash for examples where this is used in Python, see NumPy for a larger example that manages many functions that way. Hope this helps, Martin |