Issue #5700 has been updated by Nobuyoshi Nakada.


One particular case is OK, two cases would be still OK, but three cases are not exceptional already.
We'll need some standard way to tell if a given object can be discarded immediately or not, I guess.

Anyway, it would be enough for the time being.
----------------------------------------
Bug #5700: fork {} segfaults during VM cleanup when run inside Fiber
https://bugs.ruby-lang.org/issues/5700

Author: Eric Wong
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2011-12-03 trunk 33934) [x86_64-linux]


The issue is very easy to reproduce:

	Fiber.new do
	  p Process.waitpid2(fork {})
	end.resume

Parent process successfully exits, child process segfaults while
it is exiting.

Backtrace is attached (gdb_bt.txt)

MALLOC_CHECK_=3 with GNU libc malloc() implementation detects an
attempt to free invalid pointer (attachment: malloc_check_3.txt)

I can also reproduce this with 1.9.2-p290 and 1.9.3-p0 as well as
latest trunk, so it has been around a while and a fix needs to be
backported.



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