Project

General

Profile

« Previous | Next » 

Revision 86cb3d31

Added by k0kubun (Takashi Kokubun) almost 7 years ago

mjit_worker.c: promote mjit_copy_job from function

-local variable to global variable.

Consider this case:

  1. MJIT worker: dequeue ISeq (stop_worker_p was still FALSE)
  2. Ruby thread: call Kernel#exec, which calls mjit_finish(FALSE),
    sets stop_worker_p = TRUE, and fires RUBY_VM_CHECK_INTS() once
  3. MJIT worker: register copy job, but found stop_worker_p is TRUE.
    set worker_stopped = TRUE and the thread stops.
  4. Function-local job variable expires by the thread stop (this is eliminated by this commit)
  5. Ruby thread: find worker_stopped becamse TRUE, start Kernel#exec.
    Kernel#exec fails but exception is rescued.
  6. Ruby thread: call RUBY_VM_CHECK_INTS. copy job is dispatched but job variable
    is already expired.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e