Opened 14 years ago

Closed 14 years ago

#296 closed patch (fixed)

segfault on MTD from latest svn (2005-09-03)

Reported by: anonymous Owned by: Isaac Richards
Priority: minor Milestone: 0.19
Component: mythdvd Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

On a standard DVD rip I get the following.Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 49155 (LWP 26331)] 0x08055860 in DVDThread::ripTitle (this=0x80ca978, title_number=0,

to_location=@0xb62a2e40, extension=@0xb62a2e50, multiple_files=true) at jobthread.cpp:307

307 setSubName(QObject::tr("Waiting For Access to DVD"), 1); (gdb) thread apply all bt

Thread 5 (Thread 49155 (LWP 26331)): #0 0x08055860 in DVDThread::ripTitle (this=0x80ca978, title_number=0,

to_location=@0xb62a2e40, extension=@0xb62a2e50, multiple_files=true) at jobthread.cpp:307

#1 0x080583fb in DVDTranscodeThread::run (this=0x80ca978) at jobthread.cpp:859 #2 0xb74af335 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3 #3 0xb725b0d5 in pthread_start_thread () from /lib/libpthread.so.0 #4 0xb725b282 in pthread_start_thread_event () from /lib/libpthread.so.0 #5 0xb710d0ca in clone () from /lib/libc.so.6

Thread 3 (Thread 16386 (LWP 26228)): #0 0xb72617bc in nanosleep () from /lib/libpthread.so.0 #1 0x00000000 in ?? () #2 0xb725dcfa in pthread_timedsuspend_new () from /lib/libpthread.so.0 #3 0xb725a0b2 in pthread_cond_timedwait_relative () from /lib/libpthread.so.0 #4 0xb74af68f in QThread::exit () from /usr/qt/3/lib/libqt-mt.so.3 #5 0xb74af6fb in QThread::sleep () from /usr/qt/3/lib/libqt-mt.so.3 #6 0x0804e5a0 in DiscCheckingThread::run (this=0x8089fe8) at mtd.cpp:85 #7 0xb74af335 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3 #8 0xb725b0d5 in pthread_start_thread () from /lib/libpthread.so.0 #9 0xb725b282 in pthread_start_thread_event () from /lib/libpthread.so.0 #10 0xb710d0ca in clone () from /lib/libc.so.6 ---Type <return> to continue, or q <return> to quit--- Thread 2 (Thread 32769 (LWP 26227)): #0 0xb7104503 in poll () from /lib/libc.so.6 #1 0xb725ab70 in pthread_manager () from /lib/libpthread.so.0 #2 0xb725aeb3 in pthread_manager_event () from /lib/libpthread.so.0 #3 0xb710d0ca in clone () from /lib/libc.so.6

Thread 1 (Thread 16384 (LWP 26224)): #0 0xb71067c7 in select () from /lib/libc.so.6 #1 0xb792e0d0 in ?? () from /usr/qt/3/lib/libqt-mt.so.3 #2 0x0807baf8 in ?? () #3 0xb79573e0 in qt_wait_timer_max () from /usr/qt/3/lib/libqt-mt.so.3 #4 0x00000000 in ?? () #5 0xb74695e2 in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3 #6 0xb74cc429 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3 #7 0xb74cc378 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3 #8 0xb74bb62d in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3 #9 0x08063d4c in main (argc=2, argv=0xbffff894) at main.cpp:157 0x08055860 307 setSubName(QObject::tr("Waiting For Access to DVD"), 1);

Attachments (1)

mtd_296_stack.patch (2.1 KB) - added by Anduin Withers <awithers@…> 14 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 14 years ago by anonymous

Summary: segfault on MTD from latest svn (2005-09-03)segfault on MTD from latest svn (2005-09-03)
(gdb) thread apply all bt

Thread 5 (Thread 49155 (LWP 26331)):
#0  0x08055860 in DVDThread::ripTitle (this=0x80ca978, title_number=0,
    to_location=@0xb62a2e40, extension=@0xb62a2e50, multiple_files=true)
    at jobthread.cpp:307
#1  0x080583fb in DVDTranscodeThread::run (this=0x80ca978) at jobthread.cpp:859
#2  0xb74af335 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3
#3  0xb725b0d5 in pthread_start_thread () from /lib/libpthread.so.0
#4  0xb725b282 in pthread_start_thread_event () from /lib/libpthread.so.0
#5  0xb710d0ca in clone () from /lib/libc.so.6

Thread 3 (Thread 16386 (LWP 26228)):
#0  0xb72617bc in nanosleep () from /lib/libpthread.so.0
#1  0x00000000 in ?? ()
#2  0xb725dcfa in __pthread_timedsuspend_new () from /lib/libpthread.so.0
#3  0xb725a0b2 in pthread_cond_timedwait_relative () from /lib/libpthread.so.0
#4  0xb74af68f in QThread::exit () from /usr/qt/3/lib/libqt-mt.so.3
#5  0xb74af6fb in QThread::sleep () from /usr/qt/3/lib/libqt-mt.so.3
#6  0x0804e5a0 in DiscCheckingThread::run (this=0x8089fe8) at mtd.cpp:85
#7  0xb74af335 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3
#8  0xb725b0d5 in pthread_start_thread () from /lib/libpthread.so.0
#9  0xb725b282 in pthread_start_thread_event () from /lib/libpthread.so.0
#10 0xb710d0ca in clone () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---

Thread 2 (Thread 32769 (LWP 26227)):
#0  0xb7104503 in poll () from /lib/libc.so.6
#1  0xb725ab70 in __pthread_manager () from /lib/libpthread.so.0
#2  0xb725aeb3 in __pthread_manager_event () from /lib/libpthread.so.0
#3  0xb710d0ca in clone () from /lib/libc.so.6

Thread 1 (Thread 16384 (LWP 26224)):
#0  0xb71067c7 in select () from /lib/libc.so.6
#1  0xb792e0d0 in ?? () from /usr/qt/3/lib/libqt-mt.so.3
#2  0x0807baf8 in ?? ()
#3  0xb79573e0 in qt_wait_timer_max () from /usr/qt/3/lib/libqt-mt.so.3
#4  0x00000000 in ?? ()
#5  0xb74695e2 in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3
#6  0xb74cc429 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3
#7  0xb74cc378 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3
#8  0xb74bb62d in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3
#9  0x08063d4c in main (argc=2, argv=0xbffff894) at main.cpp:157
0x08055860      307         setSubName(QObject::tr("Waiting For Access to DVD"), 1);

comment:2 Changed 14 years ago by anonymous

Backing out the patch associated with Ticket #205 takes care of the segfault. Segfault is occuring on the tryLock() call at jobthread.cpp:311.

comment:3 Changed 14 years ago by Anduin Withers <awithers@…>

Line 311 doesn't make any sense, that mutex was created before the thread and lives for the life of the application. Line 307 really didn't change and should be equally safe.

I can't reproduce the bug here (not that there were any steps supplied and the implied "just run it" work for me). Are more exotic steps required?

Can you do a debug build without optimizations and post a 'thread apply all bt full' as well as the mtd log? (Your DiscCheckingThread? backtrace seems odd as well).

comment:4 Changed 14 years ago by anonymous

No real exotic steps. The attempt was done with a single dvd. After backing out the patch, I was able to rip one. Then when it was done stack two at a time to rip. The stack trace was a debug build without optimizations. This happened with both PVRs when I refreshed my installs. Without the patch in ticket #205 I can rip normally.

comment:5 Changed 14 years ago by Anduin Withers <awithers@…>

Moved to mythtv-dev for follow-ups.

comment:6 Changed 14 years ago by Isaac Richards

Milestone: 0.19

comment:7 Changed 14 years ago by mythdev@…

Priority: majorminor
Severity: highmedium

I seem to have a similiar problem. I attached my backtrace. What can I do to help fix this problem?

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 32771 (LWP 5029)] 0x0805511a in DVDThread::ripTitle (this=0x8093828, title_number=0, to_location=@0x8093894, extension=@0xb6c01e40, multiple_files=true) at jobthread.cpp:307 307 setSubName(QObject::tr("Waiting For Access to DVD"), 1);

(gdb) thread apply all bt

Thread 4 (Thread 32771 (LWP 5029)): #0 0x0805511a in DVDThread::ripTitle (this=0x8093828, title_number=0, to_location=@0x8093894, extension=@0xb6c01e40, multiple_files=true)

at jobthread.cpp:307

#1 0x0805767d in DVDPerfectThread::run (this=0x8093828) at jobthread.cpp:756 #2 0xb7648e95 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3 #3 0xb7333d62 in pthread_start_thread () from /lib/libpthread.so.0 #4 0xb7333ecf in pthread_start_thread_event () from /lib/libpthread.so.0 #5 0xb71d064a in clone () from /lib/libc.so.6

Thread 3 (Thread 16386 (LWP 5016)): #0 0xb733aaf6 in nanosleep () from /lib/libpthread.so.0 #1 0x00000000 in ?? () #2 0xb7336f28 in pthread_timedsuspend_new () from /lib/libpthread.so.0 #3 0xb7333239 in pthread_cond_timedwait@GLIBC_2.0 () from /lib/libpthread.so.0 #4 0xb76492cd in QThread::exit () from /usr/qt/3/lib/libqt-mt.so.3 #5 0xb7649345 in QThread::sleep () from /usr/qt/3/lib/libqt-mt.so.3 #6 0x0804def1 in DiscCheckingThread::run (this=0x808c6c8) at mtd.cpp:85 #7 0xb7648e95 in QThreadInstance::start () from /usr/qt/3/lib/libqt-mt.so.3 #8 0xb7333d62 in pthread_start_thread () from /lib/libpthread.so.0 #9 0xb7333ecf in pthread_start_thread_event () from /lib/libpthread.so.0 #10 0xb71d064a in clone () from /lib/libc.so.6

Thread 2 (Thread 32769 (LWP 5015)): #0 0xb71c7b1a in poll () from /lib/libc.so.6 #1 0xb7334550 in pthread_manager () from /lib/libpthread.so.0 #2 0xb7334ef1 in pthread_manager_event () from /lib/libpthread.so.0 #3 0xb71d064a in clone () from /lib/libc.so.6

Thread 1 (Thread 16384 (LWP 5010)): #0 0xb71c9c81 in select () from /lib/libc.so.6 #1 0xb7b19cec in ?? () from /usr/qt/3/lib/libqt-mt.so.3 #2 0x0000000f in ?? () #3 0x00000000 in ?? () #4 0x00000000 in ?? () #5 0xb75fd17a in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3 #6 0xb76684c1 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3 #7 0xb7668416 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3 #8 0xb7650acf in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3 #9 0x080638ed in main (argc=1, argv=0xbfc89504) at main.cpp:157 0x0805511a 307 setSubName(QObject::tr("Waiting For Access to DVD"), 1);

comment:8 Changed 14 years ago by danielk

Version: head

comment:9 Changed 14 years ago by Anduin Withers <awithers@…>

Type: defectpatch

It seems I never bothered to look at the value of DVD_VIDEO_LB_LEN (it is 2048), so when I moved video_data from a member to a local the thread stack on some systems was being exceeded.

I'm attaching a patch which fixes this issue.

Special thanks to Robin Gilks who responded to my request for more information regarding this bug.

Changed 14 years ago by Anduin Withers <awithers@…>

Attachment: mtd_296_stack.patch added

comment:10 Changed 14 years ago by Isaac Richards

Resolution: fixed
Status: newclosed

(In [8242]) Close #296 by applying patch.

Note: See TracTickets for help on using tickets.