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 memory leak in parser #18

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Conversation

Yuras
Copy link
Contributor

@Yuras Yuras commented Sep 2, 2024

Asynchronous exception can be delivered between hexml_document_parse and hexml_document_free or newForeignPnr causing a leak.

One might think that leak is very unlikely, but that's not true since hexml_document_parse is FFI call, so all async exceptions will be postponed while it's running, and delivered immediately as it returns. So any async exception during parsing causes memory leak.

Asynchronous exception can be delivered between `hexml_document_parse`
and `hexml_document_free` or `newForeignPnr` causing a leak.

One might think that leak is very unlikely, but that's not correct
since `hexml_document_parse` is FFI call, so all async exceptions
will be postponed while it's running, and delivered immediately
as it returns. So any async exceptions during parsing causes
memory leak.
@ndmitchell ndmitchell merged commit e151873 into ndmitchell:master Sep 2, 2024
8 checks passed
@ndmitchell
Copy link
Owner

Thanks! I'll make a release including this fix.

@Yuras Yuras deleted the wip/yuras/mem_leak branch September 2, 2024 13:04
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