[uClibc] [uClibc 0000214]: ldso crash with alsa on ppc

bugs at busybox.net bugs at busybox.net
Mon Apr 11 13:48:42 UTC 2005


A NOTE has been added to this issue.
======================================================================
<http://busybox.net/bugs/view.php?id=214> 
======================================================================
Reported By:                aurel
Assigned To:                uClibc
======================================================================
Project:                    uClibc
Issue ID:                   214
Category:                   Shared Library Support
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     assigned
======================================================================
Date Submitted:             04-06-2005 15:37 PDT
Last Modified:              04-11-2005 06:48 PDT
======================================================================
Summary:                    ldso crash with alsa on ppc
Description: 
I've just tried to update from uClibc-20050310 to uClibc-20050406 and this
introduced a crash in MPlayer when using -ao alsa. This crash only
happens
on ppc (iMac G3), not on x86.
I narrowed down this crash between 20050320 and 20050321, and more
precisely to patch 10044 :
http://uclibc.org/cgi-bin/viewcvs.cgi/trunk/uClibc/ldso/ldso/ldso.c?rev=10044&r1=10037&r2=10044
I investigated a bit further and found a fix by reintroducing some lines
that were dropped by patch 10044. I know this is certainly not the right
fix, but it may help to understand the problem, and at lest it fixes the
bug for me in the meantime.
So here is the patch I made. I don't understand all the details of ldso,
but I will try to help to solve this issue if you tell me what to do.
======================================================================

----------------------------------------------------------------------
 aurel - 04-06-05 16:04 
----------------------------------------------------------------------
Sorry but I've done my x86 tests a bit too quickly. In fact I have exactly
the
same problem on x86, so it's not related to ppc at all.

----------------------------------------------------------------------
 jocke - 04-06-05 23:53 
----------------------------------------------------------------------
I suppose the crash(SEGV?) happens at exit()?
Please compile ldso with debugging support and set env. variable
LD_DEBUG=1 while executing alsa. Post the debug output. Run ldso
unpatched
and with your patch.

----------------------------------------------------------------------
 aurel - 04-07-05 09:30 
----------------------------------------------------------------------
No, the bug don't happens at exit() ! It happens during mplayer
initialisation.
Here are the full logs of a crashing session, and a working session
using my patch. I also included a diff between the 2 logs.

It seems that the first "Trying to dlopen '/usr/lib/libasound.so.2'"
behave exactly the same, but second and third dlopen of libasound
behave differently.

Do you need any more output ?

----------------------------------------------------------------------
 jocke - 04-07-05 15:52 
----------------------------------------------------------------------
Let me check if I got this right:
mplayer depends on libasound so it gets loaded by ldso.
Some dlopens.
Then mplayer executes a sh script which in turn executes test after
which mplayer dlopens libasound even though libasound already
got loaded by ldso at startup?

Seems a bit stupid to dlopen libasound when mplayer already
depends on it, but it should work.

If the above is true, I think I know what the problem is and libdl
needs to be fixed

----------------------------------------------------------------------
 aurel - 04-09-05 13:03 
----------------------------------------------------------------------
No that's not exactly true, but the idea is quite the same.

mplayer depends on libasound, so it gets loaded by ldso.
Then, mplayer DON'T load any sh script ;-)
Then mplayer call some functions from libasound. Some of
thoses functions in libasound itself are then trying to
dlopen libasound. Yes libasound try to dlopen itself !
I find this quite stupid, but that's the way it works.

So your guess about the problem is probably right. It's
probably due to libasound being dlopened after having been
loaded by ldso.

----------------------------------------------------------------------
 jocke - 04-10-05 02:45 
----------------------------------------------------------------------
OK, my guess is still valid then, good. Just for the record, the problem
is
in libdl, adding a _dl_fini() to ldso just exposed the bug. Your patch
restoring the old behaviour works around the bug in libdl. Fixing libdl
will take some effort and I don't have much time the next 2 weeks as my
company
has merged with another company and they are moving into our site next
week.

----------------------------------------------------------------------
 jocke - 04-11-05 04:44 
----------------------------------------------------------------------
Could you try the libdl_1.patch(against curren SVN)? I just added?
I think this will solve you problem, but there are still a few issues
I want to fix before commiting anaything.

----------------------------------------------------------------------
 aurel - 04-11-05 06:48 
----------------------------------------------------------------------
libdl_1.patch fixes the bug perfectly !
Nice work. Thank you very much.

Issue History
Date Modified  Username       Field                    Change              
======================================================================
04-06-05 15:37 aurel          New Issue                                    
04-06-05 15:37 aurel          File Added: 01_ppc_ldso_fix.diff                  
 
04-06-05 16:04 aurel          Note Added: 0000132                          
04-06-05 23:53 jocke          Note Added: 0000134                          
04-07-05 09:29 aurel          File Added: crashing.log                     
04-07-05 09:29 aurel          File Added: patched.log                      
04-07-05 09:29 aurel          File Added: log.diff                         
04-07-05 09:30 aurel          Note Added: 0000136                          
04-07-05 15:52 jocke          Note Added: 0000137                          
04-09-05 13:03 aurel          Note Added: 0000138                          
04-10-05 02:45 jocke          Note Added: 0000139                          
04-11-05 04:44 jocke          File Added: libdl_1.patch                    
04-11-05 04:44 jocke          Note Added: 0000140                          
04-11-05 06:48 aurel          Note Added: 0000141                          
======================================================================




More information about the uClibc mailing list