ruby segfaults returning from dynamically defined method in ensure block
As best as I can work out, the conditions to reproduce this crash are:
- A begin/ensure block yields to a block passed by Enumerable (maybe passed by any compiled function?).
- Control is forced to the ensure block from 'break' being called from Enumerable.
- The ensure block contains a call to a dynamically defined method (created using define_method).
- The dynamically defined method runs.
- Instead of returning from the dynamically defined method, ruby segfaults (on windows XP), or bus errors (on OS X).
Happens on both Windows XP and Mac OS X (10.5.8). Script to reproduce and output are attached.
Updated by mame (Yusuke Endoh) about 9 years ago
- Category set to core
- Assignee changed from yugui (Yuki Sonoda) to ko1 (Koichi Sasada)
- Priority changed from Normal to 5
r26628 caused new SEGV when executing rubyspec.
Though the detail is still under investigation, I temporarily reverted the commit.
It should not be backported to 1.9.1.
Yusuke Endoh email@example.com