From: "tmm1 (Aman Gupta)" Date: 2013-11-27T17:12:32+09:00 Subject: [ruby-core:58632] [ruby-trunk - Feature #8998] string keys for hash literals should use fstrings Issue #8998 has been updated by tmm1 (Aman Gupta). Seeing some occasional segfaults in CI after this change. Not quite sure what's up yet. http://c5632.rubyci.org/~chkbuild/ruby-trunk/log/20131127T070302Z.log.html.gz #3 0x0063fb97 in rb_bug (fmt=0x67363d "Segmentation fault") at error.c:341 #4 0x00557a16 in sigsegv (sig=11, info=0x95f9c7c, ctx=0x95f9cfc) at signal.c:699 #5 #6 search_nonascii (p=0x1c
, len=, enc=0x95df180) at string.c:202 #7 coderange_scan (p=0x1c
, len=, enc=0x95df180) at string.c:232 #8 0x0057ab6e in rb_enc_str_coderange (str1=184779220, str2=173130540) at string.c:376 #9 rb_str_comparable (str1=184779220, str2=173130540) at string.c:2403 #10 0x0057bb32 in rb_str_hash_cmp (a=184779220, b=173130540) at string.c:2367 #11 fstring_cmp (a=184779220, b=173130540) at string.c:161 #12 0x00561257 in find_entry (table=0x9603aa0, key=184779220, value=0xbf9a818c) at st.c:387 #13 st_lookup (table=0x9603aa0, key=184779220, value=0xbf9a818c) at st.c:425 #14 0x00568062 in rb_fstring (str=184779220) at string.c:144 #15 0x004b00da in hash_aset_str (key=0xbf9a8234, val=0xbf9a8218, arg=3214574164, existing=0) at hash.c:1267 #16 hash_aset_str_insert (key=0xbf9a8234, val=0xbf9a8218, arg=3214574164, existing=0) at hash.c:1273 #17 0x00561dba in st_update (table=0xa069f50, key=184779220, func=0x4b0040 , arg=3214574164) at st.c:908 #18 0x004b4c0f in tbl_update (hash=184779600, key=184779220, val=171144140) at hash.c:380 #19 rb_hash_aset (hash=184779600, key=184779220, val=171144140) at hash.c:1316 ---------------------------------------- Feature #8998: string keys for hash literals should use fstrings https://bugs.ruby-lang.org/issues/8998#change-43201 Author: normalperson (Eric Wong) Status: Closed Priority: Low Assignee: Category: core Target version: current: 2.1.0 While we're introducing optimizations from frozen strings, string keys inside hashes should be frozen at the compiler level to prevent duplication. a = { "ABC" => :t } b = { "ABC" => :t } # the following ought to print true p(a.keys[0].object_id == b.keys[0].object_id) This should introduce no incompatibilities and be transparent to users of older rubies. -- http://bugs.ruby-lang.org/