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

Utilize bitshifts correctly in signals-mach.c when storing/reading the previous GC state #53868

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

gbaraldi
Copy link
Member

I have not succeed in writing a test for this, but this was found on a CI hang together with @Keno and @vtjnash.

In essence if we hit a safepoint while GC_SAFE things can go wrong
image

@gbaraldi gbaraldi requested review from vtjnash and Keno March 26, 2024 19:04
@@ -54,7 +54,7 @@ void jl_safepoint_resume_thread_mach(jl_ptls_t ptls2, int16_t tid2)
for (size_t i = 0; i < suspended_threads.len; i++) {
uintptr_t item = (uintptr_t)suspended_threads.items[i];
int16_t tid = (int16_t)item;
int8_t gc_state = (int8_t)(item >> 8);
int8_t gc_state = (int8_t)(item >> 16);
Copy link
Member

Choose a reason for hiding this comment

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

Let's do a toplevel #define for this and while we're at it, spell it 8*sizeof(int16_t).

@Keno Keno added system:mac Affects only macOS system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips labels Mar 26, 2024
@gbaraldi gbaraldi force-pushed the gb/bitshift-issues branch from baf38b1 to 4c5c6f5 Compare March 28, 2024 14:48
@Keno Keno merged commit 1e50a99 into master Mar 28, 2024
7 checks passed
@Keno Keno deleted the gb/bitshift-issues branch March 28, 2024 19:27
@vtjnash vtjnash added the backport 1.11 Change should be backported to release-1.11 label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips system:mac Affects only macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants