summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorKJ Tsanaktsidis <[email protected]>2024-07-12 15:13:22 +1000
committerKJ Tsanaktsidis <[email protected]>2024-07-19 13:44:01 +1000
commitca0dae25ed51627c411dfdbe9dec3901a321bff9 (patch)
treefd21f08e89855c3e600cea1d5b57cfdfd3e890ef /test/ruby
parente5c06005f182a980637069659843e89f48f5566c (diff)
Don't crash if madvise(MADV_FREE or MADV_DONTNEED) fails
The M:N threading stack cleanup machinery tries to call MADV_FREE on the native thread's stack, and calls rb_bug if it fails. Unfortunately, there's no way to distinguish between "You passed bad parameters to madvise" and "MADV_FREE is not supported on the kernel you are running on"; both cases just return EINVAL. This means that if you have a Ruby on a system that was built on a system with MADV_FREE and run it on a system without it, you get a crash in nt_free_stack. I ran into this because rr actually emulates MADV_FREE by just returning EINVAL and pretending it's not supported (since it can otherwise introduce nondeterministic behaviour). So if you run bootstraptest/test_ractor.rb under rr, you get this crash. I think we should just get rid of the error handling here; freeing memory like this is strictly optional anyway. [Bug #20632]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11156
Diffstat (limited to 'test/ruby')
0 files changed, 0 insertions, 0 deletions