BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000214 [uClibc] Shared Library Support crash always 04-06-05 15:37 04-22-05 11:12
Reporter aurel View Status public  
Assigned To uClibc
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0000214: 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.
Additional Information
Attached Files  01_ppc_ldso_fix.diff [^] (1,515 bytes) 04-06-05 15:37
 crashing.log [^] (23,565 bytes) 04-07-05 09:29
 patched.log [^] (24,502 bytes) 04-07-05 09:29
 log.diff [^] (4,204 bytes) 04-07-05 09:29
 libdl_1.patch [^] (9,337 bytes) 04-11-05 04:44

- Relationships

- Notes
(0000132)
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.
 
(0000134)
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.
 
(0000136)
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 ?
 
(0000137)
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
 
(0000138)
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.
 
(0000139)
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.
 
(0000140)
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.
 
(0000141)
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
04-22-05 11:12 andersen Status assigned => closed
04-22-05 11:12 andersen Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker