[uClibc 0000430]: dlopen incorrectly merges absolute library names

bugs at busybox.net bugs at busybox.net
Mon Sep 19 16:19:47 UTC 2005


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=430 
====================================================================== 
Reported By:                mfuzzey
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   430
Category:                   Shared Library Support
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             09-14-2005 03:18 PDT
Last Modified:              09-19-2005 09:19 PDT
====================================================================== 
Summary:                    dlopen incorrectly merges absolute library names
Description: 
In fact with 0.9.28 but tracker wouldn't accept that..

When two calls to dlopen are used with library names containing / but
refering to *different* libraries the second call returns the same library
as the first.

I am having this problem with python (compiled by standard buildroot) and
pygame (custom buildroot extension).
python contains a native library /usr/lib/python2.4/lib-dynload/time.so
pygame contains a native library
/usr/lib/python2.4/site-packages/pygame/time.so
These two libraries are completely different

Importing either by itself works correctly
However if both are imported in the same python process the dlopen call
for the second returns a reference to the first!

The reason is evident looking at _dl_load_shared_library in dl-elf.c
[duplicate detection is performed after removing all / parts...]

====================================================================== 

---------------------------------------------------------------------- 
 jocke - 09-14-05 15:33  
---------------------------------------------------------------------- 
yes, _dl_check_if_named_library_is_loaded() is busted. The
real fix is to stat() the lib and compare the st_dev and st_ino
fields with the already loaded libs. I don't have time ATM so you
are welcome to try fixing it yourself. 

---------------------------------------------------------------------- 
 mfuzzey - 09-15-05 01:07  
---------------------------------------------------------------------- 
I have now created a patch which I'm uploading.
It doesn't use the stat() method suggested but calls
_dl_check_if_named_library_is_loaded() with the full library name and
modifies it to compare the full names.

This works for me but it probably isn't really correct either - if a
process mixes absolute and relative dlopen calls duplicates could go
undetected. 

---------------------------------------------------------------------- 
 jocke - 09-17-05 10:07  
---------------------------------------------------------------------- 
I fixed it using st_dev and st_ino instead. Please test. 

---------------------------------------------------------------------- 
 mfuzzey - 09-19-05 07:27  
---------------------------------------------------------------------- 
Your fix works fine. Thank you. 

---------------------------------------------------------------------- 
 jocke - 09-19-05 09:19  
---------------------------------------------------------------------- 
Good, I will close this bug then. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-14-05 03:18  mfuzzey        New Issue                                    
09-14-05 03:18  mfuzzey        Status                   new => assigned     
09-14-05 03:18  mfuzzey        Assigned To               => uClibc          
09-14-05 04:47  mfuzzey        Issue Monitored: mfuzzey                     
09-14-05 08:14  andersen       version                  0.9.27 => 0.9.28    
09-14-05 15:34  jocke          Note Added: 0000531                          
09-15-05 01:07  mfuzzey        Note Added: 0000536                          
09-15-05 01:08  mfuzzey        File Added: uClibc-absolute-dynamic-load.patch   
                
09-17-05 10:07  jocke          Note Added: 0000545                          
09-19-05 07:27  mfuzzey        Note Added: 0000560                          
09-19-05 09:19  jocke          Status                   assigned => closed  
09-19-05 09:19  jocke          Note Added: 0000561                          
======================================================================




More information about the uClibc-cvs mailing list