coroutine_transfer() restores target->from after the switch, that is, after this coroutine is resumed -- by then it may have been resumed by someone else and target may be freed. With M:N threads it usually is: a Ruby thread parks by tr...ko1 (Koichi Sasada)
TestException#test_detailed_message_under_gc_compact_stress calls Exception#detailed_message inside EnvUtil.under_gc_compact_stress. The first error display of a process lazily requires the decoration gems (error_highlight, did_you_mean...ko1 (Koichi Sasada)
timer_thread_register_waiting kept the timed waiters on a single list sorted by deadline, inserting with a linear scan. A server whose connections share one timeout value -- every keep-alive loop -- makes each insert walk the whole list...ko1 (Koichi Sasada)
Since "Ractor: the dying thread collects its own objspace post-mortem" (e768a87a17), a dying Ractor thread runs rb_ractor_postmortem_free() after thread_sched_to_dead() (its GVL is gone) and after rb_ractor_living_threads_remove() -> vm_...ko1 (Koichi Sasada)
The test added by 6f176c8925 warmed two ractors before dropping RLIMIT_NPROC, assuming every subsequent Ractor.new would attempt to spawn a shared native thread and raise ThreadError. However, native_thread_check_and_create_shared widen...ko1 (Koichi Sasada)
page_pool_reclaim() advises (madvise) cold page bodies only when the OS page size is smaller than HEAP_PAGE_SIZE, because the first OS page of a body holds the in-body freelist link and the arena tag and must be spared. On systems whose...ko1 (Koichi Sasada)
A retiring shared thread -- ractor_sched_deq giving itself back, or a thread rejoining a full pool (nt->retiring) -- just returned from nt_start, leaking its rb_native_thread: the struct, the coroutine context, the condvars and the sigal...ko1 (Koichi Sasada)
None of these is reachable with default settings; each is a mine for a configuration or platform that steps on it. - timer_thread_set_timeout: a sleeper's deadline further away than INT_MAX ms truncated to a negative timeout, i.e. an ...ko1 (Koichi Sasada)
- verify_waiting_list compared w->data.timeout with itself, so the sorted-order assert was vacuously true and the waiting list's O(n) insert has been unverified even on debug builds. - timer_thread_register_waiting repeated the rel ...ko1 (Koichi Sasada)
thread_io_wait() sent every fd wait with a timeout to the blocking region (ppoll on a dedicated native thread), even under M:N. A pattern like IO#wait_readable(0.5) -- WEBrick's keepalive loop, or any flag-polling wait -- therefore cost...ko1 (Koichi Sasada)