<i>Fix SEGV in Tcl_FinalizeNotifier()</i> status still Open with 4 other changes
by
.
D 2016-03-20T12:13:48.476
J icomment Then\sanother\s(better)\scandidate\sis\sthe\sfollowing,\sinstead\sto\sremove\r\nnotiferInitMutex\sprotection.\r\n\r\n\s\s\s\s\s\s\s\s\spthread_mutex_lock(¬ifierInitMutex);\r\n\s\s\s\s\s\s\s\s\spthread_mutex_lock(¬ifierMutex);\r\n\s\s\s\s\s\s\s\s\spthread_cond_wait(¬ifierCV,\s¬ifierMutex);\r\n\s\s\s\s\s\s\s\s\spthread_mutex_unlock(¬ifierMutex);\r\n\s\s\s\s\s\s\s\s\spthread_mutex_unlock(¬ifierInitMutex);\r\n\r\nBecause\snotifierCV\sis\sprotected\sby\snotifierMutex\sin\sother\splaces\r\n(StartNotifierThread\sand\sNotifierThreadProc).\sSo\swithout\snotifierMutex\r\nlock,\sit\swould\sbe\swrong\sway\s(has\spossibility\sof\srace).\sAnd\snotiferInitMutex\r\nprotects\s"notifierCount",\setc.\r\n\r\nI\stested\sthe\sfollowing,\sand\sit\sseems\sto\sbe\sworking.\r\n\r\n---\r\n\r\n\sdebian/changelog\s\s\s\s|\s\s\s\s6\s++++++\r\n\sunix/tclUnixNotfy.c\s|\s\s\s\s2\s++\r\n\s2\sfiles\schanged,\s8\sinsertions(+)\r\n\r\ndiff\s-puN\sunix/tclUnixNotfy.c~fix-mutex-typo\sunix/tclUnixNotfy.c\r\n---\stcl8.6-8.6.5+dfsg/unix/tclUnixNotfy.c~fix-mutex-typo\t2016-03-19\s01:56:33.736475677\s+0900\r\n+++\stcl8.6-8.6.5+dfsg-hirofumi/unix/tclUnixNotfy.c\t2016-03-20\s20:42:03.421497517\s+0900\r\n@@\s-433,9\s+433,11\s@@\sTcl_FinalizeNotifier(\r\n\s\t\t\t\s\s\s\s"unable\sto\swrite\sq\sto\striggerPipe");\r\n\s\t\t}\r\n\s\t\tclose(triggerPipe);\r\n+\t\tpthread_mutex_lock(¬ifierMutex);\r\n\s\t\twhile(triggerPipe\s!=\s-1)\s{\r\n\s\t\t\s\s\s\spthread_cond_wait(¬ifierCV,\s¬ifierMutex);\r\n\s\t\t}\r\n+\t\tpthread_mutex_unlock(¬ifierMutex);\r\n\s\t\tif\s(notifierThreadRunning)\s{\r\n\s\t\t\s\s\s\sint\sresult\s=\spthread_join((pthread_t)\snotifierThread,\sNULL);
J login anonymous
J mimetype text/plain
J username [email protected]
K d3071887dbc7aeac5f5f71741239720e9f72584c
U anonymous
Z 940eee401c0c587f2c5dca8c2538bc51