Skip to content

Fixes for GC.compact#275

Merged
casperisfine merged 2 commits intomasterfrom
gc-compact
Oct 14, 2020
Merged

Fixes for GC.compact#275
casperisfine merged 2 commits intomasterfrom
gc-compact

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.

XrXr added 2 commits October 13, 2020 18:52
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.

5 participants