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

Hidden field access and debugging features #108

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Conversation

wks
Copy link
Collaborator

@wks wks commented Oct 9, 2024

The main part of this PR is fixing a bug when accessing the hidden field. Previously, when loading the payload size from the hidden field before the object, it didn't mask out the HAS_MOVED_GIVTBL flag, resulting in wrong object sizes. This PR fixes that. In both mmtk-ruby and ruby repos, we encapsulate the access to the hidden field in dedicated functions and make sure the bit masks are applied.

In the ruby repo, we also disable the code paths that result in re-embedding "heap" arrays and strings, because that is a source of dangling pointer bugs.

In the mmtk-ruby repo, we introduced the extra_assert! macro which can be enabled by the "extra_assert" Cargo feature even in release builds. We also introduced a feature for stressing Immix collectors and a safer is_mmtk_object_safe function.

Added an `extra_assert` feature which enables `extra_assert!` macros in
release builds.

Added the `immix_stress_copying` feature which enables the feature of
the same name in `mmtk-core`.

Added the `is_mmtk_object_safe` function which rejects against 0 and
unaligned addresses before calling `is_mmtk_object`.
This ensures we access the hidden header in a uniform way, preventing
mistakes such as forgetting to masking out other bits.
Enable extra assertions in release build when running CI tests.  This
will help us catch additional dangling pointer bugs.
In the `ruby` repo, we encapsulated the access to the hidden field, and
disabled the code path to re-embedding "heap" arrays and strings.
@wks wks merged commit 6986a0f into mmtk:master Oct 9, 2024
8 checks passed
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.

1 participant