Closed Bug 230018 Opened 21 years ago Closed 6 years ago

RFE: Mozilla should call XInitThreads() before gtk_init()

Categories

(Core :: Widget: Gtk, enhancement)

All
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: roland.mainz, Unassigned)

References

Details

RFE: Mozilla should call XInitThreads() before gtk_init() to ensure that code within Mozilla can safely use X11 calls from multiple threads (that would be needed for bug 230017).
I see we already have a call to XInitThreads() at http://lxr.mozilla.org/seamonkey/source/xpfe/bootstrap/nsAppRunner.cpp#1667 Problem is not all X11 implemenations have this API. I think we need a configure check for this.
Or change the line #ifdef MOZ_X11 to #if defined(MOZ_X11) && (XlibSpecificationRelease >= 6) since I believe the problem is that XInitThreads is new to X11R6.
Assignee: blizzard → nobody
Component: GFX: Gtk → Widget: Gtk
QA Contact: ian → gtk
I came across this bug via some up-to-date problem with the latest Ubuntu release (10.10) and the Mozilla-plugin of the famous VLC-player: When pause/resume a video, the audio playback gets lost [1]. One can break down this problem as follows: The VLC-plugin is forced to use the ALSA soundserver, though PulseAudio is the default soundserver in Ubuntu and should be used - but since PulseAudio uses Xlib for some operations, its usage crashes Firefox, because Firefox does not call XInitThreads() [2] during startup. [3] and [4] present some more details on the VLC-part of this problem. So this is really a more critical bug than just an 'enhancement', since this affects all Ubuntu 10.10 users with the mozilla-plugin-vlc package, which is widely used. For the moment, the only workaround is to totally switch the system to ALSA, or to wait for some newer PulseAudio implementation that does not use Xlib. The cleanest solution would be to let Firefox appropriately initialize Xlib for multi-threading. This would also allow other plugins to use Xlib functions without crashing, while it should not harm Firefox's functionality. ---- [1] http://forum.videolan.org/viewtopic.php?f=13&t=83736 [2] http://www.x.org/archive/X11R6.8.2/doc/ ... ads.3.html [3] http://trac.videolan.org/vlc/ticket/3662 [4] http://mailman.videolan.org/pipermail/v ... 01799.html
Is there a performance hit for using XInitThreads? Why aren't we running VLC in its own process? If we did, I presume that problem would go away.
oopp has been whitelist to enable instead of blacklist to prevent. i'm not sure people have actually tried vlc to see if it works. it was initially a conservative thing to reduce risk. at this point we should probably revisit that. historically (10+ years ago), gtk and threads wasn't wonderful: http://mail.gnome.org/archives/gtk-devel-list/1999-July/msg00048.html I don't think the performance hit would be big, although I'd hope that we could prove this w/ tryserver or something.
On trunk all plugins are out-of-process except for a blacklist. Unfortunately VLC is currently on the blacklist because it's Xt-based. There's a blocker bug for that with some WIP patches from Martin Stransky, though.
oh right. sorry, i did know that. good to hear about progress there.

Should be already fixed.

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.