summaryrefslogtreecommitdiff
path: root/spec/ruby/core/array/shared/push.rb
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2024-12-06 22:49:53 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2024-12-09 16:08:35 -0500
commit476d655053b0e3ea447dc6549b821d18636c6603 (patch)
treee70a7b68d55f8fa6041c1a574ad850fa8939398a /spec/ruby/core/array/shared/push.rb
parentde7feb0538266b2d66b444f4142773c2f510cdcc (diff)
objspace_dump: Use FILE* to avoid crashing in mark functions
We observed crashes from rb_io_bufwrite() thread switching (through rb_thread_check_ints()) in the middle of rb_execution_context_mark(). By the time rb_execution_context_mark() gets a timeslice again, it read garbage from a frame that was already popped in another thread, crashing the process in SEGV. Other mark functions probably have their own ways of breaking, but clearly, the usual IO code do too much for this perilous pseudo GC context. Use `FILE*` like before 5001cc47169614ea07d87651c95c2ee185e374e0 ("Optimize ObjectSpace.dump_all"). Also, add type checking for the private _dump methods. Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12285
Diffstat (limited to 'spec/ruby/core/array/shared/push.rb')
0 files changed, 0 insertions, 0 deletions