From: Ryan Davis Date: 2009-05-19T06:24:06+09:00 Subject: [ruby-core:23497] Interrupt < Signal, but initialize mismatched this problem exists on 1.8 and 1.9 and was previously reported by Eric Hodel in possibly a slightly different form/vector. > static VALUE > interrupt_init(argc, argv, self) > int argc; > VALUE *argv; > VALUE self; > { > VALUE args[2]; > > args[0] = INT2FIX(SIGINT); > rb_scan_args(argc, argv, "01", &args[1]); > > return rb_call_super(2, args); > } vs esignal_init: > if (argc < 1 || argnum < argc) { > rb_raise(rb_eArgError, "wrong number of arguments (%d for > %d)", > argc, argnum); > } Examples: > 504 % ruby -v -e 'raise Interrupt' > ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] > -e:1:in `initialize': wrong number of arguments (0 for 1) > (ArgumentError) > from -e:1:in `exception' > from -e:1:in `raise' > from -e:1 > % ruby -v -rtimeout -e 'raise Timeout::Error' > ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] > -e:1:in `initialize': wrong number of arguments (0 for 1) > (ArgumentError) > from -e:1:in `exception' > from -e:1:in `raise' > from -e:1 found via resolv.rb: > class ResolvTimeout < TimeoutError; end ... > def request(sender, tout) > timelimit = Time.now + tout > sender.send > while (now = Time.now) < timelimit > timeout = timelimit - now > if !IO.select([@sock], nil, nil, timeout) > raise ResolvTimeout > end >