[#49675] Request to update LEGAL file for zlib, UCD license — Jun Aruga <jaruga@...>

こんにちは。有賀と申します。

10 messages 2016/06/20

[ruby-dev:49667] [Ruby trunk Bug#10933] [BUG] object allocation during garbage collection phase

From: jaruga@...
Date: 2016-06-15 16:08:55 UTC
List: ruby-dev #49667
Issue #10933 has been updated by Jun Aruga.


Hello,

I am trying to create a small ruby sample code to reproduce this issue on Ruby 2.2.2 that is not updated for this issue.
(this issue was solved on Ruby 2.2.3 ).
I understood its bug happened in the process to free the dynamic symbol in GC process.

However I can not reproduce it.
So, could anyone help me for that?

> symbol.c (Init_sym): make dsym_fstrs a hash compared by identity as the keys are unique fstrings, to get rid of running hash and compare methods and causing new object allocation during garbage collection phase.


Below is my sample code that does not work..


~~~
$ cat test_gc.rb 
def display_count
  data = ObjectSpace.count_objects
  puts "Total: #{data[:TOTAL]} Free: #{data[:FREE]} Object: #{data[:T_OBJECT]}"
end

def main
  h1 = {}
  h2 = {}
  array = []
  (1..10000).each do |n|
    dynamic_symbol = n.to_s.to_sym
    h1[dynamic_symbol] = n
    h2[dynamic_symbol] = n + 1
    a = (h1 == h2) ? "b" : "c"
    array << a
    display_count
  end

  GC.start
  display_count
end

main
~~~


Thank you very much.
I appreciate it.



----------------------------------------
Bug #10933: [BUG] object allocation during garbage collection phase
https://bugs.ruby-lang.org/issues/10933#change-59244

* Author: Yoshiyuki MIKAMI
* Status: Closed
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
いつもお世話になっています。
rspec中に遭遇して、その後繰り返しても再現しないのですが、役に立てばと採取できたログをお送りします。
追加で提出すべき情報があればお知らせください。
よろしくお願いいたします。

---Files--------------------------------
crash.txt (165 KB)
ruby_2015-03-04-020941_Silver.crash (35 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next