New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GC delete referenced object.(maybe write barrier bug.) #2525
Comments
I think that this problem is not resolved radically. now reproduction codes are as follows. def delay_call(&block)
p = Proc.new do
yield
end
p
end
class C
attr_accessor :v
attr_accessor :t
def initialize iv
self.v = iv
end
end
n = 7187
m = (n / 121).floor
a = []
n.times do |j|
p = delay_call do
if j % m == 0
puts "test init #{j}"
end
end
c = C.new(
delay_call do
p.call
end
)
a[j] = c
end
n.times do |i|
n.times do |j|
if (i + j) % m == 0
p = delay_call do
if j % m == 0
puts "test m #{i} #{j}"
end
end
c = C.new(
delay_call do
p.call
end
)
a[j] = c
end
a[j].t = nil
end
a.each do |c|
c.t = nil
p = c.v.call
end
end change loop count(n) and overwriting interval(m). I wish to make more efficient reproduction codes... |
I think that following is better reproduction code. proc_gc_ef.rb
build and test script for mingw and linux. VCVAR_PATH = 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat'
MINIRAKE = '.\minirake'
puts `git clone https://github.com/mruby/mruby.git build_tmp/mruby`
puts `sh -c \"cd build_tmp/mruby; git reset --hard HEAD\"`
#puts `sh -c \"cd build_tmp/mruby; ruby minirake clean\"`
puts `sh -c \"cd build_tmp/mruby; ruby minirake\"`
puts "proc gc ef"
ret = `build_tmp/mruby/build/host/bin/mruby proc_gc_ef.rb`
succeeded ||= ret.match(/succeeded!/)
puts "#{ret}"
# before correction
puts `sh -c \"cd build_tmp/mruby; git reset --hard 2b9e5e751b4d6d1a86eb25b2a4e40f9c8d19c06c\"`
#puts `sh -c \"cd build_tmp/mruby; ruby minirake clean\"`
puts `sh -c \"cd build_tmp/mruby; ruby minirake\"`
puts "proc gc ef before correction"
ret = `build_tmp/mruby/build/host/bin/mruby proc_gc_ef.rb`
succeeded ||= ret.match(/succeeded!/)
puts "#{ret}"
if succeeded
puts "all success."
else
puts "some failed."
end Bon vacation, now. |
I think this problem is solved at 77b2ec3. I think this problem happend as follows.
another test pattern. proc_gc_ef_2.rb def delay_call(&block)
p = Proc.new do
yield
end
p
end
class C
attr_accessor :v
attr_accessor :t
def initialize iv
self.v = iv
end
end
oi = 1000
10.times do |i|
n = i * 100 + 17
[93, 121, 127].each do |j|
m = j + 1
a = []
n.times do |j|
p = nil
c = C.new(
delay_call do
p.call
end
)
p = delay_call do
if j % oi == 0
puts "test init #{j}"
end
end
a[j] = c
end
n.times do |i|
n.times do |j|
if (i + j) % m == 0
p = delay_call do
if j % oi == 0
puts "test m #{i} #{j}"
end
end
c = C.new(
delay_call do
p.call
end
)
a[j] = c
end
a[j].t = nil
end
a.each do |c|
c.t = nil
p = c.v.call
end
end
end
end
if false
[3989, 7129].each do |n|
[93, 121, 127, 1061, 131, 2647, 431].each do |j|
m = j
a = []
n.times do |j|
p = delay_call do
if j % oi == 0
puts "test init #{j}"
end
end
c = C.new(
delay_call do
p.call
end
)
a[j] = c
end
n.times do |i|
n.times do |j|
if (i + j) % m == 0
p = delay_call do
if j % oi == 0
puts "test m #{i} #{j}"
end
end
c = C.new(
delay_call do
p.call
end
)
a[j] = c
end
a[j].t = nil
end
a.each do |c|
c.t = nil
p = c.v.call
end
end
end
end
end
puts "succeeded!" |
add write barrier to env on pop call info poped. #2525
#2569 fixed this. |
This code crash mruby.
proc_gc.rb
I guess as follows cause.
I encountered on windows and linux.
follows is build code on windows.
The text was updated successfully, but these errors were encountered: