Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8194 closed defect (fixed)

Seg Fault in mythfrontend on startup with DVD in drive

Reported by: bhuffman@… Owned by: cpinkham
Priority: minor Milestone: unknown
Component: MythTV - General Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

As summary says. I've reproduced with two separate DVDs. mythfrontend logfile and gdb logs attached.

Attachments (3)

myth.log (12.2 KB) - added by bhuffman@… 10 years ago.
gdb.txt (23.6 KB) - added by bhuffman@… 10 years ago.
may_fix_the_issue_untested.diff (590 bytes) - added by skamithi 10 years ago.
turn on the myth_system_dont_block_parent flag for the mount command. prevents it from calling MythMainWindow::SetDrawEnabled?. Not sure if it breaks mounting, but worth a try I think.

Download all attachments as: .zip

Change History (17)

Changed 10 years ago by bhuffman@…

Attachment: myth.log added

Changed 10 years ago by bhuffman@…

Attachment: gdb.txt added

comment:1 Changed 10 years ago by skamithi

are you using mplayer or xine to play the DVD ? If so, looks like its crashing on x11 functions as its switching between the external dvd player and mythtv. does the same crash occur when you use the Internal player ?

comment:2 Changed 10 years ago by bhuffman@…

Actually, no. I use only the Internal player (I checked my settings to verify).

comment:3 Changed 10 years ago by andrew@…

I experiance the same problem and it happens with all DVD's. I also only use the Internal player. This also happens when inserting a DVD while mythfrontend is running.

comment:4 Changed 10 years ago by skamithi

sorry, didn't look at the trace carefully. its crashing on mount command that's part of the monitor dvd/cd feature. turn that off. why its crashing when MythMainWindow::SetDrawEnabled?() function is called I'm not sure of yet.

Changed 10 years ago by skamithi

turn on the myth_system_dont_block_parent flag for the mount command. prevents it from calling MythMainWindow::SetDrawEnabled?. Not sure if it breaks mounting, but worth a try I think.

comment:5 Changed 10 years ago by Marc Randolph <mrand@…>

Downstream user has confirmed this seg fault on any DVD he inserts. He captured a backtrace on slightly more recent build (0.23.0+fixes23789): http://launchpadlibrarian.net/42169947/Stacktrace.txt

and if it is helpful, an excesssively verbose front-end log: http://launchpadlibrarian.net/42169939/.var.log.mythtv.mythfrontend.log.txt

(from https://bugs.launchpad.net/ubuntu/+source/mythtv/+bug/549593)

comment:6 in reply to:  4 Changed 10 years ago by anonymous

Replying to skamithi:

why its crashing when MythMainWindow::SetDrawEnabled?() function is called I'm not sure of yet.

Need to be careful about threading here. MythMainWindow::SetDrawEnabled?() calls QWidget::setUpdatesEnabled(), which in turn calls QWidgetPrivate::updateSystemBackground().

Unlike QWidget::update(), updateSystemBackground() performs its actions directly in the current thread rather than scheduling the update for the GUI thread (hence the errors: "QPixmap: It is not safe to use pixmaps outside the GUI thread"). Segfault occurs because one of the pixmap errors returns a NULL which is dereferenced without validation.

comment:7 Changed 10 years ago by pmcenery@…

I have tested the above patch and confirm that it works!

comment:8 Changed 10 years ago by Marc Randolph <mrand@…>

The above user also tested mounting inside and outside of myth and found no problems.

comment:9 Changed 10 years ago by aysal@…

Today there was an update of mythbuntu in lucid...but the patch seems not to be includet... Ist there somewhere a .deb package with the patch i can download?

comment:10 Changed 10 years ago by cpinkham

Owner: changed from Isaac Richards to cpinkham
Status: newassigned

comment:11 Changed 10 years ago by cpinkham

(In [24310]) Add a helper method so that we can check whether we are in the UI thread or not. We don't want to block LIRC, the joystick, or drawing when called outside the UI thread so use this helper to check to see if we are in the UIthread. Disabling drawing from the UI thread can also cause segfaults as indicated in #8194 and #8391.

References #8194 and #8391.

This fix is only temporary in trunk. I have a different version in a local checkout that will be committed later as part of a patch to move parts of MythContext to libmythdb where they can be utilized by myth_system() and the rest of libmythui.

This does update the API version, so make clean, etc..

comment:12 Changed 10 years ago by cpinkham

Resolution: fixed
Status: assignedclosed

(In [24311]) Carry over [24310] from trunk.

Add a helper method so that we can check whether we are in the UI thread or not. We don't want to block LIRC, the joystick, or drawing when called outside the UI thread so use this helper to check to see if we are in the UIthread.

Fixes #8194 and #8391.

comment:13 in reply to:  9 Changed 10 years ago by anonymous

Replying to aysal@…:

Today there was an update of mythbuntu in lucid...but the patch seems not to be includet... Ist there somewhere a .deb package with the patch i can download?

Did you get an answer to this, or how to properly apply the mythtv.org/trac/attachment/ticket/8194/may_fix_the_issue_untested.diff patch?

comment:14 Changed 10 years ago by robertm

Ticket locked: set

This was fixed several weeks ago in -fixes. You do not need to (and should not) apply the above patch. You need to contact your packager if you have not received this fix. Please do not use our ticket system as a discussion board.

Note: See TracTickets for help on using tickets.