FernetMenta / vdr-plugin-vnsiserver

VDR plugin to handle XBMC clients.
GNU General Public License v2.0
16 stars 33 forks source link

VNSITimers segfault #87

Closed bgmvdr closed 7 years ago

bgmvdr commented 7 years ago

Using vdr-plugin-vnsiserver with vdr 2.3.2 and kodi i get permanently segfaults:

kernel: [ 4806.910898] VNSITimers[5706]: segfault at 0 ip 00007f219837d9da sp 00007f2186ffcae8 error 4 in libc-2.23.so[7f21982df000+1bf000]

FernetMenta commented 7 years ago

does not crash here. could you build with debug symbols please? without symbols and line numbers the info is not enough to track this down further

bgmvdr commented 7 years ago

It is the first time for me compiling and running gdb, so i hope i h ave done this correctly. I get this after setting a search timer in kodi:

Thread 11 "VNSITimers" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffecf03700 (LWP 3090)] __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31 31 ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: No such file or directory.

FernetMenta commented 7 years ago

If you are running with gdb and gdb breaks on the segfault, type "thread apply all bt" That should output a back trace

bgmvdr commented 7 years ago

ok, i have done so:

Thread 11 "VNSITimers" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff0fb1700 (LWP 3510)] __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31 31 ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S: No such file or directory. (gdb) thread apply all bt

Thread 15 (Thread 0x7fffcaffd700 (LWP 3517)):

0 0x00007ffff6326b5d in poll () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff63444ce in __poll_chk (fds=,

nfds=<optimized out>, timeout=<optimized out>, fdslen=<optimized out>)
at poll_chk.c:27

2 0x000000000052ce7d in poll (timeout=1000, nfds=,

__fds=0x802860 <SVDRPServerPoller>)
at /usr/include/x86_64-linux-gnu/bits/poll2.h:41

3 cPoller::Poll (this=this@entry=0x802860 ,

TimeoutMs=TimeoutMs@entry=1000) at tools.c:1506

4 0x0000000000521c61 in cSVDRPServerHandler::Action (this=0xb295d0)

at svdrp.c:2509

5 0x0000000000523f89 in cThread::StartThread (Thread=0xb295d0)

at thread.c:288

6 0x00007ffff799c6ba in start_thread (arg=0x7fffcaffd700)

at pthread_create.c:333

7 0x00007ffff633282d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 12 (Thread 0x7fffcbfff700 (LWP 3511)):

0 0x00007ffff6326b5d in poll () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff63444ce in __poll_chk (fds=,

---Type to continue, or q to quit--- nfds=, timeout=, fdslen=) at poll_chk.c:27

2 0x000000000052ce7d in poll (timeout=-1, nfds=,

__fds=0x7fffd4000bf8) at /usr/include/x86_64-linux-gnu/bits/poll2.h:41

3 cPoller::Poll (this=this@entry=0x7fffd4000bf8,

TimeoutMs=TimeoutMs@entry=-1) at tools.c:1506

4 0x00007ffff4a4b1da in cxSocket::read (this=this@entry=0x7fffd4000bc0,

buffer=buffer@entry=0x7fffcbffee60, size=size@entry=4, 
timeout_ms=timeout_ms@entry=-1) at cxsocket.c:128

5 0x00007ffff4a48284 in cVNSIClient::Action (this=0x7fffd4000b40)

at vnsiclient.c:91

6 0x0000000000523f89 in cThread::StartThread (Thread=0x7fffd4000b40)

at thread.c:288

7 0x00007ffff799c6ba in start_thread (arg=0x7fffcbfff700)

at pthread_create.c:333

8 0x00007ffff633282d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 11 (Thread 0x7ffff0fb1700 (LWP 3510)):

0 __strcmp_sse2_unaligned ()

at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31

1 0x00007ffff4a63398 in CVNSITimers::Action (this=)

at vnsitimer.c:464

---Type to continue, or q to quit---

2 0x0000000000523f89 in cThread::StartThread (Thread=0xb29078)

at thread.c:288

3 0x00007ffff799c6ba in start_thread (arg=0x7ffff0fb1700)

at pthread_create.c:333

4 0x00007ffff633282d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 10 (Thread 0x7ffff4212700 (LWP 3509)):

0 0x00007ffff62f775d in nanosleep () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff63291a4 in usleep (useconds=useconds@entry=250000)

at ../sysdeps/posix/usleep.c:32

2 0x00007ffff4a5fd41 in cVNSIStatus::Action (this=0xb29130) at status.c:307

3 0x0000000000523f89 in cThread::StartThread (Thread=0xb29130)

at thread.c:288

4 0x00007ffff799c6ba in start_thread (arg=0x7ffff4212700)

at pthread_create.c:333

5 0x00007ffff633282d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 9 (Thread 0x7ffff1a0d700 (LWP 3508)):

0 0x00007ffff6326b5d in poll () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff63444ce in __poll_chk (fds=,

nfds=<optimized out>, timeout=<optimized out>, fdslen=<optimized out>)

---Type to continue, or q to quit--- at poll_chk.c:27

2 0x000000000052ce7d in poll (timeout=50, nfds=,

__fds=0x7ffff1a0cc20) at /usr/include/x86_64-linux-gnu/bits/poll2.h:41

3 cPoller::Poll (this=this@entry=0x7ffff1a0cc20,

TimeoutMs=TimeoutMs@entry=50) at tools.c:1506

4 0x00000000004f4649 in cKbdRemote::ReadKey (this=this@entry=0xb293a0)

at remote.c:310

5 0x00000000004f4704 in cKbdRemote::ReadKeySequence (

this=this@entry=0xb293a0) at remote.c:326

6 0x00000000004f494d in cKbdRemote::Action (this=0xb293a0) at remote.c:392

7 0x0000000000523f89 in cThread::StartThread (Thread=0xb293c0)

at thread.c:288

8 0x00007ffff799c6ba in start_thread (arg=0x7ffff1a0d700)

at pthread_create.c:333

9 0x00007ffff633282d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 8 (Thread 0x7ffff220e700 (LWP 3507)):

0 0x00007ffff63289e3 in select () at ../sysdeps/unix/syscall-template.S:84

1 0x00007ffff4a5504d in cVNSIServer::Action (this=0xb29000)

at vnsiserver.c:195

2 0x0000000000523f89 in cThread::StartThread (Thread=0xb29000)

at thread.c:288

---Type to continue, or q to quit---

3 0x00007ffff799c6ba in start_thread (arg=0x7ffff220e700) at pthread_create.c:333

4 0x00007ffff633282d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 7 (Thread 0x7ffff2a0f700 (LWP 3506)):

0 0x00007ffff6326b5d in poll () at ../sysdeps/unix/syscall-template.S:84

1 0x00000000004fbf92 in poll (timeout=1000, nfds=6, __fds=0x7ffff2a0de10)

at /usr/include/x86_64-linux-gnu/bits/poll2.h:46

2 cSectionHandler::Action (this=0xb26fe0) at sections.c:184

3 0x0000000000523f89 in cThread::StartThread (Thread=0xb26fe0) at thread.c:288

4 0x00007ffff799c6ba in start_thread (arg=0x7ffff2a0f700) at pthread_create.c:333

5 0x00007ffff633282d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 6 (Thread 0x7ffff3210700 (LWP 3505)):

0 pthread_cond_timedwait@@GLIBC_2.3.2 ()

at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225

1 0x000000000052389c in cCondVar::TimedWait (this=this@entry=0xb73178, Mutex=...,

TimeoutMs=TimeoutMs@entry=1000) at thread.c:137

2 0x0000000000493735 in cDvbTuner::Action (this=0xb729f0) at dvbdevice.c:1000

3 0x0000000000523f89 in cThread::StartThread (Thread=0xb729f0) at thread.c:288

4 0x00007ffff799c6ba in start_thread (arg=0x7ffff3210700) at pthread_create.c:333

5 0x00007ffff633282d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 5 (Thread 0x7ffff3a11700 (LWP 3503)):

0 0x00007ffff6326b5d in poll () at ../sysdeps/unix/syscall-template.S:84

1 0x00000000004fbf92 in poll (timeout=1000, nfds=6, __fds=0x7ffff3a0fe10)

at /usr/include/x86_64-linux-gnu/bits/poll2.h:46

2 cSectionHandler::Action (this=0xb2a2d0) at sections.c:184

3 0x0000000000523f89 in cThread::StartThread (Thread=0xb2a2d0) at thread.c:288

4 0x00007ffff799c6ba in start_thread (arg=0x7ffff3a11700) at pthread_create.c:333

5 0x00007ffff633282d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 4 (Thread 0x7ffff4a13700 (LWP 3502)):

0 pthread_cond_timedwait@@GLIBC_2.3.2 ()

at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225

1 0x000000000052389c in cCondVar::TimedWait (this=this@entry=0xb27a28, Mutex=...,

TimeoutMs=TimeoutMs@entry=1000) at thread.c:137

2 0x0000000000493735 in cDvbTuner::Action (this=0xb272a0) at dvbdevice.c:1000

3 0x0000000000523f89 in cThread::StartThread (Thread=0xb272a0) at thread.c:288

4 0x00007ffff799c6ba in start_thread (arg=0x7ffff4a13700) at pthread_create.c:333

5 0x00007ffff633282d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7fca740 (LWP 3495)):

0 pthread_cond_timedwait@@GLIBC_2.3.2 ()

at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225

1 0x000000000052389c in cCondVar::TimedWait (

this=this@entry=0x7fae60 <cRemote::keyPressed>, Mutex=..., 
TimeoutMs=TimeoutMs@entry=1000) at thread.c:137

2 0x00000000004f4218 in cRemote::Get (WaitMs=1000, UnknownCode=UnknownCode@entry=0x0)

at remote.c:194

3 0x00000000004afb59 in cInterface::GetKey (this=, Wait=)

at interface.c:36

4 0x000000000047067b in main (argc=, argv=) at vdr.c:1179

FernetMenta commented 7 years ago

great, well done!

that tells us that it segfaults on the instruction at this line: https://github.com/FernetMenta/vdr-plugin-vnsiserver/blob/master/vnsitimer.c#L464

the only explanation I have for this is that recording->Info()->Title() is nullptr. But I have no clue how this can happen.

Do you have a recording without a title? Did you apply the recordingshandler patch to vdr 2.3.2?

bgmvdr commented 7 years ago

I have reused the recodings directory from an old yavdr installation, in kodi i see a title for each recording. I have created a search timer for SpongeBob for my kids. In the recording directory i have found a folder "SpongeBob_Schwammkopf" with episodes in it and an additional folder nested also called the same with some episodes. Could this be a problem? I did not apply any patches.

bgmvdr commented 7 years ago

There is another thought: I have viewed some episodes SpongeBob two hours ago and there was a recording which didn't play, so i deleted it. Maybe there was something wrong with it, but i didn't recognize if there was a title. And now i see the search timer rule created timer entries, it didn' this before.

bgmvdr commented 7 years ago

Yes, now i can reproduce this: I cleared the title in the info file of a recording and the segfault happens. Thank you so much!

FernetMenta commented 7 years ago

Thank you! I will add some code to prevent from this segfault.

FernetMenta commented 7 years ago

I hope this fixes it: https://github.com/FernetMenta/vdr-plugin-vnsiserver/commit/615a077be1ef669feae3b6b85291b12278577793