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

[wasm] JSObject parameters of callback from JS to managed are not released and stay inFlight #56303

Closed
pavelsavara opened this issue Jul 26, 2021 · 1 comment · Fixed by #57098
Assignees
Milestone

Comments

@pavelsavara
Copy link
Member

In my PR #54453 I introduced reference counter for objects InFlight across the JS/managed boundary.
The method extract_mono_obj increases the inflight refcount and it is decreased on managed side for return values.
But we do not decrease refcount for JSObjects passed as parameters to callbacks.

Example scenario is OnMessage callback of WebSocket. It passes Event object, which is marshaled as JSObject.
Since the callback delegate is pointing directly to the user code, we currently don't have platform place which could decrease the inflight ref count.

@pavelsavara pavelsavara self-assigned this Jul 26, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 26, 2021
@ghost
Copy link

ghost commented Jul 26, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

In my PR #54453 I introduced reference counter for objects InFlight across the JS/managed boundary.
The method extract_mono_obj increases the inflight refcount and it is decreased on managed side for return values.
But we do not decrease refcount for JSObjects passed as parameters to callbacks.

Example scenario is OnMessage callback of WebSocket. It passes Event object, which is marshaled as JSObject.
Since the callback delegate is pointing directly to the user code, we currently don't have platform place which could decrease the inflight ref count.

Author: pavelsavara
Assignees: pavelsavara
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: -

@pavelsavara pavelsavara removed the untriaged New issue has not been triaged by the area owner label Jul 27, 2021
@pavelsavara pavelsavara added this to the 6.0.0 milestone Jul 27, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 10, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 17, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant