Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@andremedeiros
Copy link
Contributor

In the Ruby implementation, the code initializes a hash and then initializes a bunch of strings before assigning the hash to a constant.

In some cases, the string allocations trigger a GC event, which will clear the hash because nothing references it.

Further down the line, the hash is frozen, but it makes Ruby processes segfault when it's been collected by GC.

This PR marks it as global to hint the GC to leave it alone.

Thank you @fbogsany for pointing me in the right direction.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

4 similar comments
@grpc-testing
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@andremedeiros
Copy link
Contributor Author

I signed it!

@grpc-testing
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

11 similar comments
@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-testing
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@grpc-kokoro
Copy link

Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure.

@apolcyn apolcyn self-assigned this Aug 21, 2017
@apolcyn
Copy link
Contributor

apolcyn commented Aug 21, 2017

jenkins: this is ok to test

@andremedeiros
Copy link
Contributor Author

@apolcyn I can't check the failures :-(

Also, I've already signed the CLA, but it's still tagged incorrectly.

@googlebot
Copy link

CLAs look good, thanks!

@apolcyn
Copy link
Contributor

apolcyn commented Aug 22, 2017

test failures look like unrelated flakes.

But wondering what ruby version did you see this on? Were you able to manually trigger GC during that require statement? It's a small change and it looks right to me, but it would be nice to be able to verify.

@andremedeiros
Copy link
Contributor Author

andremedeiros commented Aug 22, 2017

@apolcyn Thank you for checking on the failures.

We saw it on 2.3.3. I really wish there was a test I could add, but it happens super infrequently, and we'd basically need a hook between the moment the hash gets initialized and when the values get set. In other words, I don't know how to get this done and verify it without a hook in the C extension that would only be there for the sake of testing.

@apolcyn
Copy link
Contributor

apolcyn commented Aug 24, 2017

lgtm, but tests have gone stale, so waiting for a re-run

@andremedeiros
Copy link
Contributor Author

Looks much better. Want me to rebase master into this branch?

@apolcyn
Copy link
Contributor

apolcyn commented Aug 24, 2017

rebase isn't needed since there's no conflicts

@andremedeiros
Copy link
Contributor Author

👍

@apolcyn
Copy link
Contributor

apolcyn commented Aug 24, 2017

infrastructure failure on mac tests

@apolcyn apolcyn merged commit f28955d into grpc:master Aug 24, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants