• unknown's avatar
    BUG#24507 (rpl_log.test crash slave): · 9f37ea45
    unknown authored
    The problem was located to lie inside current NPTL pthread_exit() 
    implementation. Race conditions in this code can lead to segmentation
    fault. Hovewer, this can happen only in a race between first thread 
    calling pthread_exit() and other threads. 
    
    Workaround implemented in this patch spawns a dummy thread, which
    exits immediately, during thread lib initialization. This will exclude
    segment violations when further threads exit.
     
    
    
    include/my_pthread.h:
      define macro NPTL_PTHREAD_EXIT_BUG which controls whether workaround
      in my_thread_global_init() is included or not.
    mysys/my_thr_init.c:
      Spawn a dummy thread in my_thread_global_init() to initialize pthread 
      lib internal variables.
    9f37ea45
my_thr_init.c 8.87 KB