[ruby-cvs:70927] normal:r63836 (trunk): thread_pthread.c (native_thread_destroy): clear native TSD pointer

normal at ruby-lang.org normal at ruby-lang.org
Tue Jul 3 17:30:16 JST 2018


normal	2018-07-03 17:30:16 +0900 (Tue, 03 Jul 2018)

  New Revision: 63836

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63836

  Log:
    thread_pthread.c (native_thread_destroy): clear native TSD pointer
    
    mwrap <https://80x24.org/mwrap/> interposes malloc functions and
    checks for GVL existence to determine Ruby source locations of
    malloc calls.  pthread_getattr_np (from get_stack) may call
    realloc to get the CPU set size; so when using the thread-cache,
    ruby_thread_has_gvl_p() may hit a false positive on reused
    threads with lingering rb_thread_t in thread-specific data.
    
    This was causing mwrap to call rb_source_location_cstr() and
    crash because it was pointed to a zero ec->cfp->iseq.

  Modified files:
    trunk/thread_pthread.c


More information about the ruby-cvs mailing list