[#89430] [Ruby trunk Misc#15229] DevelopersMeeting201801122Japan — mame@...
Issue #15229 has been reported by mame (Yusuke Endoh).
3 messages
2018/10/17
[#89555] [Ruby trunk Feature#15251] Hash aset should deduplicate non tainted string — chopraanmol1@...
Issue #15251 has been updated by chopraanmol1 (Anmol Chopra).
3 messages
2018/10/25
[#89583] [PATCH] vm_trace.c (postponed_job_register): only hit main thread — Eric Wong <normalperson@...>
@hsbt: I post here on ruby-core because I hit errors with
5 messages
2018/10/27
[#89584] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Koichi Sasada <ko1@...>
2018/10/27
thank you for you patch.
[#89590] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Eric Wong <normalperson@...>
2018/10/28
Koichi Sasada <[email protected]> wrote:
[#89621] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — Greg.mpls@...
Issue #14867 has been updated by MSP-Greg (Greg L).
4 messages
2018/10/29
[#89622] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/29
[email protected] wrote:
[#89627] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
3 messages
2018/10/30
[#89654] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
4 messages
2018/10/31
[#89655] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/31
[email protected] wrote:
[ruby-core:89602] [Ruby trunk Bug#15262][Feedback] GCing of object in use
From:
nobu@...
Date:
2018-10-28 10:39:59 UTC
List:
ruby-core #89602
Issue #15262 has been updated by nobu (Nobuyoshi Nakada).
Description updated
Status changed from Open to Feedback
larskanis (Lars Kanis) wrote:
> Although `start_adder` works with a `WeakRef`, the `Adder` object should still be GC marked, since `Adder.new` doesn't return before all calls to `start_adder` finished.
> ```ruby
> @count.times do
> Thread.new(WeakRef.new(self), &self.class.method(:start_adder))
> end
This method doesn't wait these threads which run `start_adder`.
> ## Actual behavior:
>
> The program stops with a probability of approximately 80% with the following error:
So this behavior seems expected.
----------------------------------------
Bug #15262: GCing of object in use
https://bugs.ruby-lang.org/issues/15262#change-74639
* Author: larskanis (Lars Kanis)
* Status: Feedback
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.6.0dev (2018-10-27 trunk 65390) [x86_64-linux]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Given the following program:
```ruby
require "weakref"
Thread.abort_on_exception = true
class Adder
def self.start_adder(obj)
obj.add
end
def initialize
@qu = Queue.new
@mutex = Mutex.new
@mutex.lock
begin
@count = 10
@count.times do
Thread.new(WeakRef.new(self), &self.class.method(:start_adder))
end
ensure
@mutex.unlock
end
@qu.deq
end
def add
@mutex.lock
begin
@count-=1
if @count == 0
@qu.enq true
elsif @count < 0
raise "shouldn't happen"
end
ensure
@mutex.unlock
end
end
end
def test_adder
10.times.map do
Thread.new do
Adder.new
end
end.each(&:join)
end
100.times do
test_adder
end
```
## Expected behaviour:
The program should simply execute without error. This is the case on JRuby but not on MRI.
## Actual behavior:
The program stops with a probability of approximately 80% with the following error:
```
$ ruby -W2 adder-test.rb
#<Thread:[email protected]:6 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
adder-test.rb:7:in `start_adder': Invalid Reference - probably recycled (WeakRef::RefError)
Traceback (most recent call last):
adder-test.rb:7:in `start_adder': Invalid Reference - probably recycled (WeakRef::RefError)
```
Although `start_adder` works with a `WeakRef`, the `Adder` object should still be GC marked, since `Adder.new` doesn't return before all calls to `start_adder` finished.
I verified this on ruby-trunk, but get mostly the same behavior on all older MRI versions.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>