[Pkg-tcltk-devel] Bug#818697: Bug#818697: libtcl8.6: Segv in Tcl_FinalizeNotifier()

Sergei Golovan sgolovan at nes.ru
Mon Mar 21 11:45:37 UTC 2016


Hi Hirofumi,

On Sun, Mar 20, 2016 at 3:09 PM, OGAWA Hirofumi
<hirofumi at mail.parknet.co.jp> wrote:
>
> I see. Then another candidate is the following.
>
>          pthread_mutex_lock(&notifierInitMutex);
>          pthread_mutex_lock(&notifierMutex);
>          pthread_cond_wait(&notifierCV, &notifierMutex);
>          pthread_mutex_unlock(&notifierMutex);
>          pthread_mutex_unlock(&notifierInitMutex);
>
> Because notifierCV is protected by notifierMutex in other places
> (StartNotifierThread and NotifierThreadProc). So without notifierMutex
> lock, it would be wrong way (has possibility of race).

You're right, notifierCV is to be protected by notifierMutex, so this idea
for the fix looks much better. As far as I can see, you've posted the
patch to the upstream bugtracker, thank you. Let's then wait a bit for
the Tcl developers answer.

Cheers!
-- 
Sergei Golovan



More information about the Pkg-tcltk-devel mailing list