Skip to content
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

Fixed a memory bug with RepeatedField#+. #8970

Merged
merged 1 commit into from Sep 13, 2021

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.

None yet

3 participants