[#84867] [Ruby trunk Bug#14357] thread_safe tests suite segfaults — v.ondruch@...

Issue #14357 has been reported by vo.x (Vit Ondruch).

11 messages 2018/01/15

[#84980] [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — hsbt@...

Issue #13618 has been updated by hsbt (Hiroshi SHIBATA).

10 messages 2018/01/23
[#85012] Re: [Ruby trunk Feature#13618][Assigned] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — Eric Wong <normalperson@...> 2018/01/23

hsbt@ruby-lang.org wrote:

[ruby-core:85299] [Ruby trunk Bug#13776] Refined methods ignore visibility of inherited methods

From: usa@...
Date: 2018-01-31 13:13:40 UTC
List: ruby-core #85299
Issue #13776 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: DONE to 2.2: REQUIRED, 2.3: DONE, 2.4: DONE

ruby_2_3 r62134 merged revision(s) 59444,59445.

----------------------------------------
Bug #13776: Refined methods ignore visibility of inherited methods
https://bugs.ruby-lang.org/issues/13776#change-70079

* Author: Mon_Ouie (Mon ou誰e)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.5.0dev (2017-07-28 trunk 59438) [x86_64-linux]
* Backport: 2.2: REQUIRED, 2.3: DONE, 2.4: DONE
----------------------------------------
This bug was pointed out by al2o3-cr on the #ruby IRC channel on freenode. The following code sleeps for 3 seconds, even though `String#sleep` is a private method.

```ruby
module Test
  refine String do
    def sleep; end
  end
end

puts "start"
"".sleep 3
puts "end"
```

This happens because `vm_call_method_each_type`, when running a method of type `VM_METHOD_TYPE_REFINED`, uses `vm_call_zsuper` to call inherited methods, which does not check the visibility of the method and directly executes it. I attached a patch which changes this code path and uses `vm_call_method` to trigger the code that honors method visibilities. I have not played extensively with this patch, but it at least does not seem to break any existing unit tests.

---Files--------------------------------
refinement.patch (1.74 KB)


-- 
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>

In This Thread

Prev Next