-
Notifications
You must be signed in to change notification settings - Fork 9
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
Lens module memory management is broken #62
Labels
bug
Something isn't working
Comments
AndrewSisley
added a commit
to AndrewSisley/defradb
that referenced
this issue
Nov 8, 2023
It only half fixes this, it will be solved properly in lens-vm/lens#62
AndrewSisley
added a commit
to AndrewSisley/defradb
that referenced
this issue
Nov 10, 2023
It only half fixes this, it will be solved properly in lens-vm/lens#62
AndrewSisley
added a commit
to AndrewSisley/defradb
that referenced
this issue
Nov 10, 2023
It only half fixes this, it will be solved properly in lens-vm/lens#62
AndrewSisley
added a commit
to sourcenetwork/defradb
that referenced
this issue
Nov 10, 2023
## Relevant issue(s) Resolves #2036 ## Description Fix module relying on closed memory leak. It only half fixes this, it will be solved properly in lens-vm/lens#62
shahzadlone
pushed a commit
to shahzadlone/defradb
that referenced
this issue
Feb 23, 2024
## Relevant issue(s) Resolves sourcenetwork#2036 ## Description Fix module relying on closed memory leak. It only half fixes this, it will be solved properly in lens-vm/lens#62
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment, the allocation of memory for input params is owned by the host, yet the freeing is handled by the module.
The return param allocation is managed by the module, but the freeing is not done explicitly (this might be a rare race condition, or a leak).
I think we need to add a new module
free(ptr, size)
function. The host should call into the wasm module to free input and return values, and allocate input memory. Allocating return value mem can remain within the module.New Lens tests need too be written, as there is at least one test gap here, that was only caught by defra:
TestSchemaMigrationQueryMigrationCopiesExistingFieldWhenSrcFieldNotRequested
- relied on a previous memory leak encouraged by the current model.The text was updated successfully, but these errors were encountered: