Skip to content

Fix #10785 - Fix invalid access of GC memory from destructor when inside a GC finalizer with debug build #10787

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

schveiguy
Copy link
Member

This caused a segfault in testing the new GC on windows, as this new GC is more aggressive uncomitting freed memory.

redo of #10786

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @schveiguy!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

  • In preparation for migrating from Bugzilla to GitHub Issues, the issue reference syntax has changed. Please add the word "Bugzilla" to issue references. For example, Fix Bugzilla Issue 12345 or Fix Bugzilla 12345.(Reminder: the edit needs to be done in the Git commit message, not the GitHub pull request.)

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + phobos#10787"

@kinke
Copy link
Contributor

kinke commented May 21, 2025

Style checker:

std/uni/package.d(1788:20)[warn]: Local imports should specify the symbols being imported to avoid hiding local symbols.

Check GC.inFinalizer when writing debug garbage to referenced GC array, as
this is not valid to do when called from the GC.
@schveiguy schveiguy force-pushed the uni-gc-cowarray-segfault branch from 2f06ad4 to 11830d5 Compare May 21, 2025 22:26
@schveiguy
Copy link
Member Author

stylechecker fixed

@schveiguy schveiguy changed the title Fix #10785 - Fix invalid access of GC memory from destructor when inside a GC finalizer Fix #10785 - Fix invalid access of GC memory from destructor when inside a GC finalizer with debug build May 21, 2025
@kinke kinke merged commit 35637c1 into dlang:stable May 22, 2025
10 checks passed
@Geod24
Copy link
Member

Geod24 commented May 22, 2025

Style checker:

We really need to get rid of this error message. It's been 20 or 30 releases that this bug has been fixed IIRC.

@schveiguy schveiguy deleted the uni-gc-cowarray-segfault branch May 22, 2025 15:16
@schveiguy
Copy link
Member Author

Need another PR, there is still some CowArray problems with the reference count...

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.

6 participants