[#75687] [Ruby trunk Bug#12416] struct rb_id_table lacks mark function — shyouhei@...
Issue #12416 has been reported by Shyouhei Urabe.
3 messages
2016/05/23
[#75763] [Ruby trunk Feature#12435] Using connect_nonblock to open TCP connections in Net::HTTP#connect — mohamed.m.m.hafez@...
Issue #12435 has been reported by Mohamed Hafez.
3 messages
2016/05/28
[#75774] Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock — Mohamed Hafez <mohamed.m.m.hafez@...>
Hi all, every now and then in my production server, I'm
4 messages
2016/05/30
[#75775] Re: Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock
— Mohamed Hafez <mohamed.m.m.hafez@...>
2016/05/30
Or does MRI's OpenSSL::SSL::SSLSocket#connect_nonblock just return
[#75782] Important: Somewhat backwards-incompatible change (Fwd: [ruby-cvs:62388] duerst:r55225 (trunk): * string.c: Activate full Unicode case mapping for UTF-8) — Martin J. Dürst <duerst@...>
With the change below, I have activated full Unicode case mapping for
4 messages
2016/05/31
[ruby-core:75725] [Ruby trunk Bug#12430] Segfault in irb when improperly using coerce in combination with method_missing
From:
gregory.t.brown@...
Date:
2016-05-25 21:23:19 UTC
List:
ruby-core #75725
Issue #12430 has been updated by Gregory Brown.
ruby -v set to ruby 2.3.1p112
----------------------------------------
Bug #12430: Segfault in irb when improperly using coerce in combination with method_missing
https://bugs.ruby-lang.org/issues/12430#change-58852
* Author: Gregory Brown
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.1p112
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Don't ask how or why I wrote this code, but suppose you have a class like this:
~~~
class BrokenNumber
def initialize(num)
@num = num
end
def method_missing(m, *a, &b)
@num.send(m, *a, &b)
end
def coerce(other)
[self, self]
end
end
~~~
Then you require this code in IRB, and you create a new instance (x) and you then call 2+x.
The first call will raise a SystemStackError. The second will cause a segmentation fault.
~~~
>> require "./broken"
=> true
>> x = BrokenNumber.new(2)
=> #<BrokenNumber:0x007f8b5a84c190 @num=2>
>> 2 + x
SystemStackError: stack level too deep
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
... 7559 levels...
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from /Users/gtb/broken.rb:7:in `+'
from /Users/gtb/broken.rb:7:in `method_missing'
from (irb):3:in `+'
from (irb):3
from /Users/gtb/.rubies/ruby-2.3.1/bin/irb:11:in `<main>'
>> 2 + x
Segmentation fault: 11
MacBook-Pro:~ gtb$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
~~~
I've asked multiple people to confirm this and they've reproduced the error. I have no clue how to debug it, but thought it may be worth mentioning... even though it's a strange corner case and invalid code.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>