[vlc-devel] Deadlock in freetype module
Sergey E. Galanov
sgsoftware at mail.ru
Sun Aug 17 21:11:26 CEST 2008
After upgrading to the latest version of vlc in my gentoo distribution
there has appeared a problem: while playing any video file the window
output remains black, while sound goes normally.
When, compiled in debug mode, vlc simply crashes because of mutex
assertion failure. This problem is caused by a deadlock situation in the
Here is a code excerpt from file 'modules/misc/freetype.c':
p_lock = var_acquire_mutex("fontbuilder");
var_AddCallback(p_fontbuilder, "build-done", FontBuilderDone, p_filter);
var_SetBool(p_this, "build-done", true);
Here we have an obvious deadlock: FontBuilderAttach acquires mutex
"fontbuilder", and FontBuilderDone
which is being called from that function (via var_TriggerCallback)
acquires the same mutex.
Perhaps, it is assumed that in this case 'newval.b_bool' is always
false, but since it deadlocks, this assumption is wrong :)
Of course I don't have any insight into this code and contexts from
which it may be called, but it seems to me that the
call to var_TriggerCallback is erroneous, since callback should be
called when builder thread has finished its work. So I just
commented this call. It worked fine for me.
With this bug vlc is absolutely unusable.
Best regards, Sergey Galanov
More information about the vlc-devel