ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:92412] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
@ 2019-04-26  0:01 ` jean.boussier
  2019-04-26  0:05 ` [ruby-core:92413] " jean.boussier
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: jean.boussier @ 2019-04-26  0:01 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been reported by byroot (Jean Boussier).

----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:92413] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
  2019-04-26  0:01 ` [ruby-core:92412] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state jean.boussier
@ 2019-04-26  0:05 ` jean.boussier
  2019-04-26 15:08 ` [ruby-core:92421] " jean.boussier
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: jean.boussier @ 2019-04-26  0:05 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been updated by byroot (Jean Boussier).


Actually, even simpler repro script:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true

puts "Before garbage_collection: a=#{a.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect}"
```


----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792#change-77770

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:92421] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
  2019-04-26  0:01 ` [ruby-core:92412] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state jean.boussier
  2019-04-26  0:05 ` [ruby-core:92413] " jean.boussier
@ 2019-04-26 15:08 ` jean.boussier
  2019-04-26 20:21 ` [ruby-core:92424] " s.wanabe
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: jean.boussier @ 2019-04-26 15:08 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been updated by byroot (Jean Boussier).


Édouad Chin bisected the script against the MRI repository, and found https://bugs.ruby-lang.org/issues/15251 the first commit to trigger the problem.

That being said it's unlikely to really be the source of the bug. It's much more likely to be in the `fstring` function.



----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792#change-77778

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:92424] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-04-26 15:08 ` [ruby-core:92421] " jean.boussier
@ 2019-04-26 20:21 ` s.wanabe
  2019-04-27 12:38 ` [ruby-core:92434] " nobu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: s.wanabe @ 2019-04-26 20:21 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been updated by wanabe (_ wanabe).


I guess it is caused by the combination of `str_duplicate` and `rb_fstring` from r52074.

```
$ cat bug15792.rb 
a = ('a' * 24).b.strip

->{ eval "", binding, a, 1 }.call

puts "Before garbage_collection: a=#{a.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect}"

$ ./miniruby -v bug15792.rb 
ruby 2.3.0dev (2015-10-07 trunk 52074) [x86_64-linux]
Before garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa"
After garbage_collection: a="\x00B\xFB\xCCmU\x00\x00\x10\x10\xE7\xCCmU\x00\x00aaaaaaaa"
```

----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792#change-77780

* Author: byroot (Jean Boussier)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:92434] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2019-04-26 20:21 ` [ruby-core:92424] " s.wanabe
@ 2019-04-27 12:38 ` nobu
  2019-08-07 11:45 ` [ruby-core:94173] [Ruby master " nagachika00
  2019-08-26 15:59 ` [ruby-core:94575] " usa
  6 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2019-04-27 12:38 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been updated by nobu (Nobuyoshi Nakada).

Status changed from Open to Closed

Thank you, fixed at https://git.ruby-lang.org/ruby.git/commit/?id=3f9562015e651735bfc2fdd14e8f6963b673e22a.

----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792#change-77789

* Author: byroot (Jean Boussier)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:94173] [Ruby master Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2019-04-27 12:38 ` [ruby-core:92434] " nobu
@ 2019-08-07 11:45 ` nagachika00
  2019-08-26 15:59 ` [ruby-core:94575] " usa
  6 siblings, 0 replies; 7+ messages in thread
From: nagachika00 @ 2019-08-07 11:45 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been updated by nagachika (Tomoyuki Chikanaga).

Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: REQUIRED to 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE

ruby_2_6 r67731 merged revision(s) 3f9562015e651735bfc2fdd14e8f6963b673e22a,c06ddfee878524168e4af07443217ed2f8d0954b,3b3b4a44e57dfe03ce3913009d69a33d6f6100be.

----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792#change-80430

* Author: byroot (Jean Boussier)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ruby-core:94575] [Ruby master Bug#15792] GC can leave strings used as hash keys in a corrupted state
       [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2019-08-07 11:45 ` [ruby-core:94173] [Ruby master " nagachika00
@ 2019-08-26 15:59 ` usa
  6 siblings, 0 replies; 7+ messages in thread
From: usa @ 2019-08-26 15:59 UTC (permalink / raw
  To: ruby-core

Issue #15792 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.4: REQUIRED, 2.5: REQUIRED, 2.6: DONE to 2.4: REQUIRED, 2.5: DONE, 2.6: DONE

ruby_2_5 r67766 merged revision(s) 3f9562015e651735bfc2fdd14e8f6963b673e22a,c06ddfee878524168e4af07443217ed2f8d0954b,3b3b4a44e5.

----------------------------------------
Bug #15792: GC can leave strings used as hash keys in a corrupted state
https://bugs.ruby-lang.org/issues/15792#change-81033

* Author: byroot (Jean Boussier)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.6.2
* Backport: 2.4: REQUIRED, 2.5: DONE, 2.6: DONE
----------------------------------------
The following script showcase the issue:

```
#!/usr/bin/env ruby --disable-gems
a = ('a' * 24).encode(Encoding::ASCII).gsub('x', '')
b = ('b' * 24).encode(Encoding::ASCII).gsub('x', '')

hash = {}
hash[a] = true
hash[b] = true

puts "Bebore garbage_collection: a=#{a.inspect} b=#{b.inspect}"
4.times { GC.start }
puts "After garbage_collection: a=#{a.inspect} b=#{b.inspect}"
```

Expected output:

```
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
```

Actual output:

```
Ruby: 2.6.2
Bebore garbage_collection: a="aaaaaaaaaaaaaaaaaaaaaaaa" b="bbbbbbbbbbbbbbbbbbbbbbbb"
After garbage_collection: a="}\x0Eu\xDB\xFC\a\x00\x80\xE9\ru\xDB\xFC\a\x00\x10\x04\x00aaaaaa" b="\x00\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00\x00\xC0\x02\x00bbbbbb"
```

We reduced the repro script as much as we could, both the `.encode(ASCII)` and the `gsub` are necessary for the bug to manifest itself.

We also used `ObjectSpace.dump()` to analyze the corrupted string.

```
b = "shared":true, "encoding":"US-ASCII", "references":["0x7faf4a01aeb8"]
0x7faf4a01aeb8 = "frozen":true, "fstring":true, "bytesize":24, "value":"bbbbbbbbbbbbbbbbbbbbbbbb", "encoding":"US-ASCII"
```

Big thanks to Édouard Chin who did most of the initial repro reduction.



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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-08-26 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-15792.20190426000054@ruby-lang.org>
2019-04-26  0:01 ` [ruby-core:92412] [Ruby trunk Bug#15792] GC can leave strings used as hash keys in a corrupted state jean.boussier
2019-04-26  0:05 ` [ruby-core:92413] " jean.boussier
2019-04-26 15:08 ` [ruby-core:92421] " jean.boussier
2019-04-26 20:21 ` [ruby-core:92424] " s.wanabe
2019-04-27 12:38 ` [ruby-core:92434] " nobu
2019-08-07 11:45 ` [ruby-core:94173] [Ruby master " nagachika00
2019-08-26 15:59 ` [ruby-core:94575] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).