• Zhiyi Zhang's avatar
    rtworkq: Avoid closing a thread pool object while its callbacks are running. · f3bab6c5
    Zhiyi Zhang authored
    Consider a thread A running scheduled_item_cancelable_callback() and a thread B running queue_cancel_item(),
    which is the scenario from canceling a work item right after it gets submitted by RtwqScheduleWorkItem().
    When the CloseThreadpoolTimer() call in queue_cancel_item() in thread B runs before the queue_release_pending_item()
    in scheduled_item_cancelable_callback() in thread A, scheduled_item_cancelable_callback() ends up
    calling work_item_Release() and CloseThreadpoolTimer() is called again for the same timer object. So
    the thread pool timer object end up getting released while the scheduled_item_cancelable_callback()
    is running, triggering the '!object->num_running_callbacks' assertion in tp_object_release(). This
    is actually a double free but the assertion happens before the second free could happen. The same
    thing could happen for thread pool wait objects as well.
    
    Fix mf and mfmediaengine tests sometimes trigger the '!object->num_running_callbacks' assertion.
    
    Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55724
    f3bab6c5
Name
Last commit
Last update
dlls Loading commit data...
documentation Loading commit data...
fonts Loading commit data...
include Loading commit data...
libs Loading commit data...
loader Loading commit data...
nls Loading commit data...
po Loading commit data...
programs Loading commit data...
server Loading commit data...
tools Loading commit data...
.editorconfig Loading commit data...
.gitlab-ci.yml Loading commit data...
.mailmap Loading commit data...
ANNOUNCE.md Loading commit data...
AUTHORS Loading commit data...
COPYING.LIB Loading commit data...
LICENSE Loading commit data...
LICENSE.OLD Loading commit data...
MAINTAINERS Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
aclocal.m4 Loading commit data...
configure Loading commit data...
configure.ac Loading commit data...