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

Fix componentize::GetMemBuffer #184

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tschneidereit
Copy link
Member

This patch fixes an issue where if the return value of sbrk(0) ever changed after initially being set, we'd encounter a panic: the value is stored in a PersistentRootedObject, AB, which the code tries to initialize multiple times. Persistent roots can't only be initialized ones, after which they have to be set.

This patch fixes an issue where if the return value of `sbrk(0)` ever changed after initially being set, we'd encounter a panic: the value is stored in a `PersistentRootedObject`, `AB`, which the code tries to initialize multiple times. Persistent roots can't only be initialized ones, after which they have to be `set`.
@tschneidereit
Copy link
Member Author

I don't know how to build a reasonable test for this, but it fixes an issue we encountered in the real world.

@guybedford
Copy link
Collaborator

Nice, I can imagine this must have been very tricky to track down. Thanks I wasn't aware of this persistent rooted behaviour!

@guybedford
Copy link
Collaborator

Happy to merge, but for testing, what conditions would trigger it? Large memory use at Wizer time?

@guybedford
Copy link
Collaborator

If so maybe it's as simple as a test with a large source text?

@tschneidereit
Copy link
Member Author

It's happening at runtime, not during wizening. I think it might be related to malloc, not GC allocation, but that's hard to reduce

@guybedford
Copy link
Collaborator

Right, so maybe a call with a very large buffer that causes a page size increase, followed by another call?

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.

2 participants