-
Notifications
You must be signed in to change notification settings - Fork 245
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
Kotlin bindings error: java.lang.AssertionError: Handle map is not returning the object we just placed there. This is a bug in the HandleMap.
#1610
Comments
Can you show your code? |
Here is the Kotlin repo: https://github.com/polywrap/kotlin-client/tree/kris/uniffi-rework The error occurs when calling The Rust There is no problem calling |
UPDATE Here is a maximally simple reproduction of the error: polywrap/kotlin-client#40 The issue occurs when a call is made from a Wasm module, to Rust native code, which then calls Kotlin code through UniFFI bindings. |
Note that in the original case the error was occurring the SECOND time the call to the Kotlin object was made: Kotlin base |
Some logs for you, from printlns I added to the generated handlemap. These logs come from after I fixed the bug on our end. The original issue was that the kotlin object inserted into the handlemap was a new instance of the object that was already there. It seems like a race condition. Now my code works, but uniffi prints a lot of errors (which don't seem to affect whether my code actually functions). The new exceptions are caused by attempts to get the kotlin object from the handlemap that is dropped at the end of this log. It's important to know that our Rust code is completely synchronous.
|
Hi,
UPDATE: I now think the problem is a race condition. More details are provided in the comments below.
I am getting the following exception thrown in Kotlin uniffi bindings. Could anyone suggest some possible causes of this?
The full error is here, though a lot of the context is not uniffi-related.

┆Issue is synchronized with this Jira Task
┆Issue Number: UNIFFI-290
The text was updated successfully, but these errors were encountered: