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

workerd: Use --single-threaded-gc #803

Merged
merged 2 commits into from
Jun 22, 2023
Merged

workerd: Use --single-threaded-gc #803

merged 2 commits into from
Jun 22, 2023

Conversation

ohodson
Copy link
Contributor

@ohodson ohodson commented Jun 22, 2023

workerd: Use --single-threaded-gc

Consecutive requests could lead to calling into the isolate whilst code pages are being collected. This problem has only been observed on macOS arm64.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386

ohodson added a commit that referenced this pull request Jun 22, 2023
Consecutive requests could lead to calling into the isolate whilst
code pages are being collected. This problem has only been observed
on macOS arm64.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386
Review: #803
@ohodson ohodson requested a review from kentonv June 22, 2023 17:45
@kentonv
Copy link
Member

kentonv commented Jun 22, 2023

Is this a bug in V8? Or is our code doing something wrong / unusual that causes this?

Can we #ifdef the fix to mac, if it's only seen on mac?

Consecutive requests could lead to calling into the isolate whilst
code pages are being collected. This problem has only been observed
on macOS arm64.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386
Review: #803
This reverts commit d0ac3f3.

The preceding commit adding --single-threaded-gc addresses the issue.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386
@ohodson
Copy link
Contributor Author

ohodson commented Jun 22, 2023

Is this a bug in V8? Or is our code doing something wrong / unusual that causes this?

In our use case, a GC has been triggered by a request and happens to be still running when the next request is handled. Normally, you'd expect synchronization logic to prevent executable pages losing the X bit whilst the code is still reachable. macOS has some different page permission constraints and I don't yet know if the problem is a failure in synchronization, an assumption that doesn't apply in the workerd use case, or if there is something that is missing in jsg.

Can we #ifdef the fix to mac, if it's only seen on mac?

Done.

@ohodson ohodson merged commit 80514ab into main Jun 22, 2023
ohodson added a commit that referenced this pull request Jun 22, 2023
Consecutive requests could lead to calling into the isolate whilst
code pages are being collected. This problem has only been observed
on macOS arm64.

Bug: CUSTESC-29094
Bug: cloudflare/workers-sdk#2386
Review: #803
@ohodson ohodson deleted the orion/dont-gc-live-code branch June 22, 2023 20:54
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.

🐛 BUG: wrangler dev --experimental-local slows down over time and leaks memory
2 participants