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

Fixes for GC.compact #275

Merged
merged 2 commits into from Oct 14, 2020
Merged

Fixes for GC.compact #275

merged 2 commits into from Oct 14, 2020

Conversation

XrXr
Copy link
Contributor

@XrXr XrXr commented Oct 13, 2020

Without doing this the GC could move the objects returned by
rb_const_get and make Semian's globals point to unexpected objects on
the heap.

No tests here because usually compaction bugs are hard to trigger reliably. I'm trying to trigger them in #274 though. If it goes well maybe we should include that as a best-effort regression test.

Without doing this the GC could move the objects returned by
rb_const_get and make Semian's globals point to unexpected objects on
the heap.
Without using `extern` in the header file it was making multiple
definitions of the same variable.
Copy link
Contributor

@pushrax pushrax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there must be quite a lot of code in the wild that has this bug...

@casperisfine
Copy link
Contributor

I feel like there must be quite a lot of code in the wild that has this bug...

Yes, plenty of extensions have this issue.

@casperisfine casperisfine merged commit 8022307 into master Oct 14, 2020
@casperisfine casperisfine deleted the gc-compact branch October 14, 2020 08:45
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems October 14, 2020 08:56 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants