[#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:75336] [Ruby trunk Bug#12344] check_funcall_respond_to behavior seems incorrect
From:
matthew.bedalov@...
Date:
2016-05-03 21:20:50 UTC
List:
ruby-core #75336
Issue #12344 has been reported by Matt Bedalov.
----------------------------------------
Bug #12344: check_funcall_respond_to behavior seems incorrect
https://bugs.ruby-lang.org/issues/12344
* Author: Matt Bedalov
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Prior to ruby 2.3, and specifically I believe prior to the implementation of this change:
> Thu Aug 20 14:13:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
> vm_eval.c (check_funcall_respond_to)
> share the behavior with rb_obj_respond_to. [ruby-core:70460] [Bug #11465]
>
> vm_method.c (vm_respond_to)
> extract from rb_obj_respond_to and merge r39881.
When a global method_missing was defined, I believe that "check_funcall_respond_to" would not yield that the to_hash method would be defined for objects of type String. In Ruby 2.3, it behaves as if to_hash is defined on a String just due to the fact that we've added a global method_missing. This is hugely problematic when calling a gsub as the second parameter is checked (in str_gsub - string.c:4593) to see if it will act like a hash - i.e. is it a Hash or does it have a to_hash method. It appears that eventually vm_respond_to() calls METHOD_ENTRY_BASIC() which then makes the false statement that the object responds to the to_hash method.
I believe that a possible fix is to have vm_eval.c - check_funcall_respond_to be changed from:
~~~
static int
check_funcall_respond_to(rb_thread_t *th, VALUE klass, VALUE recv, ID mid)
{
return vm_respond_to(th, klass, recv, mid, TRUE);
}
~~~
**to**:
~~~
static int
check_funcall_respond_to(rb_thread_t *th, VALUE klass, VALUE recv, ID mid)
{
return rb_obj_respond_to(recv, mid, TRUE);
}
~~~
With the current behavior, the following in my opinion is incorrectly throwing the NameError in the method missing.
def method_missing(name, *args, &block)
raise NameError, "#{name} not defined on #{self.inspect}"
end
puts "foo".gsub(/o/, "bar")
--
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>