Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Driver or VDR Problem setting and jusageing cutmarks on Nexus 2.1



Ludwig Nussel wrote:
> Dr. Werner Fink wrote:
> > On Sat, Jun 05, 2004 at 07:13:35PM +0200, Ludwig Nussel wrote:
> > > Dr. Werner Fink wrote:
> > > > On Fri, Jun 04, 2004 at 10:09:28PM +0200, Andreas Share wrote:
> > > > > i have tested the patch, but it does not work for me. I have the same
> > > > > problem as before....if i use the nptl enabled glibc pthread libs (/lib/i686
> > > > > & /lib/tls) the rcu expansion does not work anymore (hang) and all vdr
> > > > > threats runīs at least with only one pid. I dont have tested setting and
> > > > > moving cutmarks....
> > > > 
> > > > Normally the threads based on NPTL do have only one process and therefore
> > > > only one pid.  This is the reason why for signal handling the masks have to
> > > > be set appropiate for each thread and the process to be sure that the
> > > > thread which should reveive a signal does get it (-> POSIX requires this).
> > > > The simple way as for the old pthread does not work ... or better the
> > > > result is not predictable within NPTL.
> > > 
> > > I doubt it's only the signal handling. It looks like a
> > > synchronization problem to me. It seems vdr tries to play the
> > > recording and display the still picture at the same time when
> > > jumping between cutmarks. I added some LOCK_THREAD into cDvbDevice
> > > functions, that makes at least the displayed garbage go away but
> > > there are still hangs or even deadlocks.
> > 
> > Could you detect the thread which locked up?   What does
> > ps -um --pid <pid_of_vdr> say?
> 
> This is the vdr-1.2.6 package + thread.[ch] from vdr 1.3.9 + your
> patch + LOCK_THREADs in cDvbDevice. I have no idea which threads
> lock up.

No clue how to properly debug this with gdb, here is a try. vdr
doesn't respond to keypresses in this state:

[0] root@defiant:/var/tmp/build-root.compiler.9.1-i386/usr/src/packages/BUILD/vdr-1.2.6 # gdb /var/tmp/build-root.compiler.9.1-i386/usr/src/packages/BUILD/vdr-1.2.6/vdr `pidof vdr`
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

Attaching to program: /var/tmp/build-root.compiler.9.1-i386/usr/src/packages/BUILD/vdr-1.2.6/vdr, process 8483
Reading symbols from /lib/libcap.so.1...done.
Loaded symbols for /lib/libcap.so.1
Reading symbols from /usr/lib/libjpeg.so.62...done.
Loaded symbols for /usr/lib/libjpeg.so.62
Reading symbols from /lib/tls/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 1076287616 (LWP 8483)]
[New Thread 1085340592 (LWP 8494)]
[New Thread 1083239344 (LWP 8493)]
[New Thread 1080683440 (LWP 8486)]
[New Thread 1078582192 (LWP 8485)]
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libstdc++.so.5...done.
Loaded symbols for /usr/lib/libstdc++.so.5
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_compat.so.2...done.
Loaded symbols for /lib/libnss_compat.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libnss_nis.so.2...done.
Loaded symbols for /lib/libnss_nis.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
0xffffe410 in ?? ()
(gdb) bt
#0  0xffffe410 in ?? ()
#1  0xbfffef18 in ?? ()
#2  0x00000002 in ?? ()
#3  0x00000000 in ?? ()
#4  0x40067bfe in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#5  0x40064c00 in _L_mutex_lock_33 () from /lib/tls/libpthread.so.0
#6  0x00000000 in ?? ()
#7  0xffffffff in ?? ()
#8  0x08123228 in __JCR_LIST__ ()
#9  0x08160adc in ?? ()
#10 0x00000270 in ?? ()
#11 0xbfffef38 in ?? ()
#12 0x080c8ff2 in cMutex::Lock (this=0x40067bfe) at thread.c:101
Previous frame identical to this frame (corrupt stack?)
(gdb) thread 1
[Switching to thread 1 (Thread 1076287616 (LWP 8483))]#0  0xffffe410 in ?? ()
(gdb) bt
#0  0xffffe410 in ?? ()
#1  0xbfffef18 in ?? ()
#2  0x00000002 in ?? ()
#3  0x00000000 in ?? ()
#4  0x40067bfe in __lll_mutex_lock_wait () from /lib/tls/libpthread.so.0
#5  0x40064c00 in _L_mutex_lock_33 () from /lib/tls/libpthread.so.0
#6  0x00000000 in ?? ()
#7  0xffffffff in ?? ()
#8  0x08123228 in __JCR_LIST__ ()
#9  0x08160adc in ?? ()
#10 0x00000270 in ?? ()
#11 0xbfffef38 in ?? ()
#12 0x080c8ff2 in cMutex::Lock (this=0x40067bfe) at thread.c:101
Previous frame identical to this frame (corrupt stack?)
(gdb) thread 2
[Switching to thread 2 (Thread 1085340592 (LWP 8494))]#0  0xffffe410 in ?? ()
(gdb) bt
#0  0xffffe410 in ?? ()
#1  0x40b0f968 in ?? ()
#2  0x00000389 in ?? ()
#3  0x00000000 in ?? ()
#4  0x400658e0 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0
#5  0x080c9543 in cCondVar::TimedWait (this=0xfffffffc, Mutex=@0x8163b4c, TimeoutMs=1000) at thread.c:65
#6  0x08086bcd in cNonBlockingFileReader::Action (this=0x8163b08) at dvbplayer.c:166
#7  0x080c8cd1 in cThread::StartThread (Thread=0x8163b08) at thread.c:178
#8  0x400639dd in start_thread () from /lib/tls/libpthread.so.0
#9  0x4020fffa in clone () from /lib/tls/libc.so.6
(gdb) thread 3
[Switching to thread 3 (Thread 1083239344 (LWP 8493))]#0  0xffffe410 in ?? ()
(gdb) bt
#0  0xffffe410 in ?? ()
#1  0x4090e868 in ?? ()
#2  0x00000064 in ?? ()
#3  0x00000001 in ?? ()
#4  0x40206dc4 in poll () from /lib/tls/libc.so.6
#5  0x080cc803 in cPoller::Poll (this=0x1, TimeoutMs=-4) at tools.c:530
#6  0x0807f34a in cDvbDevice::Poll (this=0x8160ad0, Poller=@0x4090e930, TimeoutMs=-4) at dvbdevice.c:1222
#7  0x08087fa9 in cDvbPlayer::Action (this=0x81636e0) at dvbplayer.c:538
#8  0x080c8cd1 in cThread::StartThread (Thread=0x81636ec) at thread.c:178
#9  0x400639dd in start_thread () from /lib/tls/libpthread.so.0
#10 0x4020fffa in clone () from /lib/tls/libc.so.6
(gdb) thread 4
[Switching to thread 4 (Thread 1080683440 (LWP 8486))]#0  0xffffe410 in ?? ()
(gdb) bt
#0  0xffffe410 in ?? ()
#1  0x4069e8c8 in ?? ()
#2  0x00000064 in ?? ()
#3  0x00000001 in ?? ()
#4  0x40206dc4 in poll () from /lib/tls/libc.so.6
#5  0x080cc803 in cPoller::Poll (this=0x1, TimeoutMs=-4) at tools.c:530
#6  0x080bf6e6 in cKbdRemote::Action (this=0x8163658) at remote.c:252
#7  0x080c8cd1 in cThread::StartThread (Thread=0x8163668) at thread.c:178
#8  0x400639dd in start_thread () from /lib/tls/libpthread.so.0
#9  0x4020fffa in clone () from /lib/tls/libc.so.6
(gdb) thread 5
[Switching to thread 5 (Thread 1078582192 (LWP 8485))]#0  0xffffe410 in ?? ()
(gdb) bt
#0  0xffffe410 in ?? ()
#1  0x4049c908 in ?? ()
#2  0x00000267 in ?? ()
#3  0x00000000 in ?? ()
#4  0x400658e0 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0
#5  0x080c9543 in cCondVar::TimedWait (this=0xfffffffc, Mutex=@0x8160a2c, TimeoutMs=1000) at thread.c:65
#6  0x08083662 in cDvbTuner::Action (this=0x8160910) at dvbdevice.c:287
#7  0x080c8cd1 in cThread::StartThread (Thread=0x8160910) at thread.c:178
#8  0x400639dd in start_thread () from /lib/tls/libpthread.so.0
#9  0x4020fffa in clone () from /lib/tls/libc.so.6
(gdb) thread 6
Thread ID 6 not known.
(gdb) 

Debug printf's showed me:

cDvbTuner thread started (pid=8483, tid=1078582192)
cKbdRemote thread started (pid=8483, tid=1080683440)
entering main loop with tid 1076287616
cDvbPlayer thread started (pid=8483, tid=1083239344)
cNonBlockingFileReader thread started (pid=8483, tid=1085340592)

An external sent SIGTERM arrives at 1076287616, SIGIO at 1078582192,
SIGPIPE at 1076287616. All three trigger the signal handler but vdr
keeps unresponsive. SIGALRM terminated vdr.

I'm going to make a patch of the modifications. I lost track what I
modified at some point so it's a mess atm.

cu
Ludwig

-- 
(o_  Ludwig.Nussel@gmx.de
//\  PGP Key ID: FF8135CE
V_/_ ICQ:        52166811




Home | Main Index | Thread Index