[Bug 745516] xvimagesink: race condition causes crash in XCB

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Mar 4 02:52:34 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=745516

--- Comment #7 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
(In reply to Vincent Penquerc'h from comment #5)
> (In reply to Sebastian Dröge (slomo) from comment #4)
> > Why do we need XInitThreads() for xvimagesink? Where are we using the same
> > display connection from multiple threads?
> 
> Do you mean it's not supposed to ?

It's not, it should use a different connection per thread because of the X11
threading mess :)

> > The GL code does that, yes. But an application has to call XInitThreads()
> > *before* using any X11 API. So also before e.g. gtk_init(). Otherwise things
> > break in horrible ways. That's why we do it there conditional on an
> > environment variable to opt-in.
> 
> If GTK/GDK uses X calls, it should call XInitThreads itself, no ? If any
> library or program that uses X calls calls XInitThreads, then you can be
> sure that it is called when needed, without a program that uses libraries
> that calls X but does not itself call X directly having to call XInitThreads
> itself. I can repeat that with parentheses if needed, it reads a bit
> confusing :)

GTK/GDK does not use threading with X11, so why would it have to call that? But
if anything in your application does, you have to call that before gtk_init().
It's really a mess.

> The presence of the env var hints that calling it more than once is bad
> though, but I see no mention of that in the manpage...

Calling it more than once is not a problem AFAIK, but calling it *after
anything* used X11 APIs already is a big problem. That's why we can't just
unconditonally call it in plugins.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list