[#87847] undefined symbol: mjit_init_p — Leam Hall <leamhall@...>

I pulled Ruby trunk on 3 Jul and am now getting errors similar to the

10 messages 2018/07/07

[#88088] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — normalperson@...

Issue #14937 has been reported by normalperson (Eric Wong).

9 messages 2018/07/24

[ruby-core:88119] [Ruby trunk Bug#14939] [PATCH] cont.c (ec_switch): prevent delayed/missed trap interrupt race

From: ko1@...
Date: 2018-07-26 06:39:04 UTC
List: ruby-core #88119
Issue #14939 has been updated by ko1 (Koichi Sasada).


Good point. Seems good. Thank you!


BTW, I forget that why the trap handler is limited to main thread.

```
trap(:INT) do
  p Thread.current
end

Thread.new{
  sleep 1
  Process.kill :INT, $$
  p [:child, Thread.current]
}.join
sleep 10
p [:main, Thread.current]

__END__

[:child, #<Thread:0x00000125801a3028@t.rb:5 run>]
#<Thread:0x00000125801e9c80 run>
# after 10 seconds
[:main, #<Thread:0x00000125801e9c80 run>]
```

Can we relax this limitation?


----------------------------------------
Bug #14939: [PATCH] cont.c (ec_switch): prevent delayed/missed trap interrupt race
https://bugs.ruby-lang.org/issues/14939#change-73141

* Author: normalperson (Eric Wong)
* Status: Open
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: REQUIRED
----------------------------------------
ko1: I noticed this while working on timer-thread elimination/lazy-spawning.
However, it looks like a bug we introduced in 2.5 with `ec'.
Can you check this patch? Thanks.


cont.c (ec_switch): prevent delayed/missed trap interrupt race

timer-thread may set trap interrupt with rb_threadptr_check_signal
at any time independent of GVL.  This means timer-thread may set
the trap interrupt flag on the previous execution context; causing
the flag to be unnoticed until a future ec switch (or lost
completely if the ec is done).

Note: I avoid relying on th->interrupt_lock here and use
atomics because we won't be able to rely on it for proposed lazy
timer-thread [Misc #14937].

This regression affects Ruby 2.5 as it was introduced by moving
interrupt_flag to `ec' which is an unstable pointer.  Ruby <= 2.4
was unaffected because vm->main_thread->interrupt_flag never
changed.


---Files--------------------------------
0001-cont.c-ec_switch-prevent-delayed-missed-trap-interru.patch (1.54 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next