Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3a01934725aefaca8fe1380c4f124bc86493d8cd
Ticket: d3071887dbc7aeac5f5f71741239720e9f72584c
Fix SEGV in Tcl_FinalizeNotifier()
User & Date: anonymous on 2016-03-18 16:46:22
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    When closing wish, process die at 
    
    		    pthread_cond_wait(&notifierCV, &notifierMutex);
    
    if cpu is supporting HLE/RTM. (xend instruction doesn't allow to use without
    xbegin)
    
    I.e. Tcl_FinalizeNotifier() is using combination
    
    	pthread_mutex_lock(&notifierInitMutex);
    	pthread_cond_wait(&notifierCV, &notifierMutex);
    	pthread_mutex_unlock(&notifierInitMutex);
    
    From history, this is clearly conversion mistake. notifierInitMutex should be
    notifierMutex (no Init).
    
    ---
    
     unix/tclUnixNotfy.c |    4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff -puN unix/tclUnixNotfy.c~fix-mutex-typo unix/tclUnixNotfy.c
    --- tcl8.6-8.6.5+dfsg/unix/tclUnixNotfy.c~fix-mutex-typo	2016-03-19 01:25:29.900145502 +0900
    +++ tcl8.6-8.6.5+dfsg-hirofumi/unix/tclUnixNotfy.c	2016-03-19 01:24:20.795871648 +0900
    @@ -417,7 +417,7 @@ Tcl_FinalizeNotifier(
     #ifdef TCL_THREADS
     	ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
     
    -	pthread_mutex_lock(&notifierInitMutex);
    +	pthread_mutex_lock(&notifierMutex);
     	notifierCount--;
     
     	/*
    @@ -460,7 +460,7 @@ Tcl_FinalizeNotifier(
     #endif /* __CYGWIN__ */
     	tsdPtr->waitCVinitialized = 0;
     
    -	pthread_mutex_unlock(&notifierInitMutex);
    +	pthread_mutex_unlock(&notifierMutex);
     #endif /* TCL_THREADS */
         }
     }
    _
    
  5. foundin changed to: "8.6.5"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "c519df2ef36ff620b5da086214b301d7a3872019"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "49. Threading"
  15. title changed to: "Fix SEGV in Tcl_FinalizeNotifier()"
  16. type changed to: "Bug"