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

we met the "null pointer" exception--kotlinx.datetime.Instant.toString #467

Open
ericCHensssssssss opened this issue Dec 17, 2024 · 3 comments
Labels
waiting for clarification Additional information is needed from the user

Comments

@ericCHensssssssss
Copy link

Exception: null function object produced when i use kotlinx.datetime.Instant.toString

#00: [#23] 0xf5c8 - kotlin.collections.toList <- we met the "null pointer" exception here.
#1: [#17] 0xf0ec - kotlin.collections.distinct
#2: [#1804] 0x2857b - kotlinx.datetime.internal.format.OptionalFormatStructure.
#3: 0x1f984 - kotlinx.datetime.format.AbstractDateTimeFormatBuilder.appendOptionalImpl
#4: 0x1f654 - kotlinx.datetime.format.optional
#5: 0x1f691 - kotlinx.datetime.format.optional$default
#6: 0x2d396 - kotlinx.datetime.ISO_DATE_TIME_OFFSET_WITH_TRAILING_ZEROS$lambda.invoke
#7: 0x2d3ea - kotlinx.datetime.ISO_DATE_TIME_OFFSET_WITH_TRAILING_ZEROS$lambda.invoke
#8: 0x1c940 - kotlinx.datetime.format.Companion.Format
#9: 0x2d404 - kotlinx.datetime.
#10: 0x2cc5b - kotlinx.datetime.<get-ISO_DATE_TIME_OFFSET_WITH_TRAILING_ZEROS>
#11: 0x2d149 - kotlinx.datetime.Instant.toString
#12: 0x2f380 - myTest

@dkhalanskyjb
Copy link
Collaborator

Could you provide the code where this happens?

@ericCHensssssssss
Copy link
Author

// 使用示例
@WasmExport
fun myTest() {

val now = Clock.System.now()
println("the time is"+now)

}

This code will produce the error,i run wasm at micro-wasm-runtime

image

image

@dkhalanskyjb
Copy link
Collaborator

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?

@dkhalanskyjb dkhalanskyjb added the waiting for clarification Additional information is needed from the user label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for clarification Additional information is needed from the user
Projects
None yet
Development

No branches or pull requests

2 participants