Skip to content

Conversation

haberman
Copy link
Member

We need to fuse the arrays so that the second array's data stays live.

Fixes: #8420

I was only able to reproduce the failure under Valgrind. Our Ruby library doesn't have Valgrind tests at the moment, so I didn't add a regression test for now. When we are able to add Valgrind tests, the following snippet triggered the bug:

require 'google/protobuf'

GC.stress = true
x = Google::Protobuf::RepeatedField.new(:string, [])
y = Google::Protobuf::RepeatedField.new(:string, ["1", "2", "3"])
z = x + y
y = nil
puts z[0]

We need to fuse the arrays so that the second array's data
stays live.
@haberman haberman merged commit ac02d6c into protocolbuffers:3.18.x Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants