-
Notifications
You must be signed in to change notification settings - Fork 644
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
Exception: null function object #3949
Comments
kotlin-wasm-wasi-example-wasm-wasi.wasm.zip |
it work well use wasmedge |
would you mind uploading the wasm again? kotlin-wasm-wasi-example-wasm-wasi.wasm seems broken and is failed for validation, even with wabt tools vscode ➜ /SDF/030_github_issues/3949 $ /opt/wabt-1.0.36/bin/wasm-validate --enable-all ./kotlin-wasm-wasi-example-wasm-wasi.wasm
0000063: error: unexpected type form (got -0x32)
vscode ➜ /SDF/030_github_issues/3949 $ /opt/wabt-1.0.36/bin/wasm-validate --enable-gc ./kotlin-wasm-wasi-example-wasm-wasi.wasm
0000063: error: unexpected type form (got -0x32)
vscode ➜ /SDF/030_github_issues/3949 $ /opt/wabt-1.0.36/bin/wasm-validate ./kotlin-wasm-wasi-example-wasm-wasi.wasm
0000063: error: unexpected type form (got 0x4e) |
Seems not important. Let's focus on @TianlongLiang 's question. |
This is the command i used. method name is myTest ./iwasm -f myTest kotlin-wasm-wasi-example-wasm-wasi.wasm |
i reupload the files. please help to check ,thanks |
Would you mind sharing with us the output of running ⬆️ commands? It will be better if adding "-v=5" |
i added some more logs 。the error log is the last two lines。 -----more detail logs PUSH_REF,value: 0x112042b68 |
It might be another problem. Here is the details:
|
…tification_referrer_id=NT_kwDOCercKbUxMzczODI0NjM2NjoxNjYzODY3Mjk#issuecomment-2536050908
this is the bug project which produce the error. Your analysis seems reasonable,but it can work well at wasmedge runtime |
It appears to be a challenging issue. I will start from the beginning to reproduce it and plan to insert some logging to aid my understanding. Would you mind:
|
1、Assume that you already have a development environment for Kotlin and Gradle 3、git clone https://github.com/ericCHensssssssss/kotlin-wasm-wasi-template If you have any other request,please let me know,thanks。 |
@lum1n0us if you need i Reproduce it and add some more logs, I think it is ok。 |
Thanks. I've met several problems and definitely needs some help. Here are my steps:
This is the callstack:
I logged every
|
git clone https://github.com/Kotlin/kotlinx-datetime.git build. <= HERE. what's the command? like $ ./gradlew ? git clone https://github.com/ericCHensssssssss/kotlin-wasm-wasi-template ----change the Gradle dependencies version of Kotlinx-datetime** build the project. <= HERE. what's the command? $ ./gradlew wasmWasiWasmEdgeRun will fail |
I feel like your analysis is right, it just feels weird that it works on wasmEdge, i am not familiar with wasmEdge,So Thanks for you keep help。 |
@lum1n0us i raised a question at kotlinx-datatime, the response from kotlinx-datatime is: Sorry, I couldn't reproduce your issue. When I run the code you provided in a Wasm/WASI test, the test passes with no problems. I don't know how to use "micro-wasm-runtime" to run Wasm programs. If you provide a self-contrained step-by-step instruction, I could look into it, but otherwise, I'd suspect that it's the runtime's fault: how come this code runs just fine in the browser? |
0xf5c5 | 14 d0 07 | call_ref type_index:976 <- Exception: null function object is it possible,This ref is global,no need set 。 |
need init the func-ref when struct.new ? ref.func $kotlin.collections.ArrayList.___fun_84 |
Finally, I've set up both Kotlin projects. After quickly reviewing the code, particularly BugReproduce2.kt. I must admit I'm not well-versed in Kotlin. But I'll share what I observed. In common/src/Instant.kt, now() is defined as So, could you please run BugReproduce2 in Kotlin? If it is doable, would you mind adding some logs around
|
About this. you are right. The function uses a global value of type #28 which is a member of a value of type #104. There are only 16 global values of type #104. Out of these, only 4 have a non-null value of type #28 as members. Moreover, when the exception occurs, none of the 4 are in use. It doesn't seem to be a problem with execution. It appears more like an issue of incomplete implementation. |
sorry?I don't fully understand, do you mean the Kotlin test project is incomplete implementation or the wasmr incomplete implementation? |
--Thanks ,I've been waiting to hear from you,I want use wasm-micro-runtime in iot,i try wasmEdge,wasm ..., I find wasm-micro-runtime is the best for me。
---it is ok ,Instant.now() maybe changed in the future,so suggest uses override fun now() function。
-- what logs you want to have。i saw you the last response, maybe incomplete implement。 so it means no need to add logs, sorry,not understand fully |
…tification_referrer_id=NT_kwDOCercKbUxMzczODI0NjM2NjoxNjYzODY3Mjk#issuecomment-2536050908
…tification_referrer_id=NT_kwDOCercKbUxMzczODI0NjM2NjoxNjYzODY3Mjk#issuecomment-2536050908
…tification_referrer_id=NT_kwDOCercKbUxMzczODI0NjM2NjoxNjYzODY3Mjk#issuecomment-2536050908
Struggled with Gradle and was defeated. :( Appreciate the details on where the function is. Looking at the call stack, I'm thinking the error might happen when calculating the field variable. I plan to use logging to find out:
|
Hi ,do you have some new findings |
Might need some help. I am trying to use
Any suggestion? diff --git a/build.gradle.kts b/build.gradle.kts
index 0c16b80..f8ea463 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -54,6 +54,7 @@ kover {
}
dependencies {
+ implementation("org.jetbrains.kotlin:kotlin-reflect:2.1.0")
kover(project(":kotlinx-datetime"))
kover(project(":kotlinx-datetime-serialization"))
}
diff --git a/core/common/src/internal/format/FormatStructure.kt b/core/common/src/internal/format/FormatStructure.kt
index 16f2317..64fae57 100644
--- a/core/common/src/internal/format/FormatStructure.kt
+++ b/core/common/src/internal/format/FormatStructure.kt
@@ -8,6 +8,7 @@ package kotlinx.datetime.internal.format
import kotlinx.datetime.internal.format.formatter.*
import kotlinx.datetime.internal.format.parser.*
import kotlinx.datetime.internal.isAsciiDigit
+import kotlin.reflect.full.memberProperties // -> to make sure every element returned by basicFormat(format) includes a member named 'field'.
internal sealed interface FormatStructure<in T> {
fun parser(): ParserStructure<T> |
Error report when i run wasm app which build from kotlin .
I find the [wasm-micro-runtime] codes missed some logic.please check the screen shot, i have marked the lost parts
Method wasm_struct_obj_set_field at gc_object.c
The text was updated successfully, but these errors were encountered: