[mythtv-commits] Ticket #4206: frontend segfault when switching resolutions for playback
MythTV
mythtv at cvs.mythtv.org
Mon Dec 3 01:32:24 UTC 2007
#4206: frontend segfault when switching resolutions for playback
---------------------------------------------+------------------------------
Reporter: George Nassas <gnassas at mac.com> | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone: unknown
Component: mythtv | Version: head
Severity: medium | Resolution:
Mlocked: 0 |
---------------------------------------------+------------------------------
Comment(by George Nassas <gnassas at mac.com>):
This ticket can be closed, I've traced it to a mesa bug and I'll persue it
further over there.
For anyone keeping score at home various myth threads open and close the
display for local queries. Inside X11 this eventually works its way down
to dri_glx.c::OpenDriver which dlopen's the correct .so on the first call.
Subsequent calls get the handle from that initial dlopen.
Unfortunately this doesn't increment the reference count for the .so and a
dlclose at the first nested XOpenDisplay/XCloseDisplay (like in
libmythtv's get_glx_version) causes the dri library to be unloaded and
soon after that MythTV go boom. The unload message in the initial report
turned out to be the key, something I realized moments after submitting
the bug.
The quick fix, and this is Linux-specific, is to tweak the inital search
at the top of OpenDriver in mesa's dri_glx.c. The match should change
from:
{{{
if (strcmp(driver->name, driverName) == 0) {
/* found it */
return driver;
}
}}}
to
{{{
if (strcmp(driver->name, driverName) == 0) {
/* found it */
char *libPath = ((struct link_map *)(driver->handle))->l_name;
dlopen(libPath, RTLD_NOW | RTLD_GLOBAL);
return driver;
}
}}}
make sure you #include <link.h> at the top.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/4206#comment:1>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list