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

build wasm file to AOT, report error Unsupported opcode: 0x8 WASM_OP_THROW #4088

Open
ericCHensssssssss opened this issue Feb 15, 2025 · 19 comments
Labels

Comments

@ericCHensssssssss
Copy link

when i build wasm file to aot, it report errors. it seems not support WASM_OP_THROW

./wamrc --enable-gc -o test.aot --target=armv7 test.wasm

Create AoT compiler with:
target: armv7
target cpu:
target triple: armv7-pc-linux-gnu
cpu features:
opt level: 3
size level: 3
output format: AoT file
Unsupported opcode: 0x8

@yamt
Copy link
Collaborator

yamt commented Feb 17, 2025

it's expected because currently exception-handling is only implemented for the classic interpreter.

@ericCHensssssssss
Copy link
Author

Thanks for your quick response,i compile Kotlin to WebAssembly ,do you plan to support the exception-handling feature in AOT,

@lum1n0us
Copy link
Collaborator

I haven't heard of any further plans from the community regarding exception handling in AOT. This is partly because the exception-handling proposal underwent significant changes at the end of last year, and the version implemented by WAMR is now considered "legacy exception handling." This makes it difficult to extend the current interpreter's solution to AOT mode.

@lum1n0us lum1n0us added the new feature New feature request label Feb 17, 2025
@ericCHensssssssss
Copy link
Author

i want run Kotlin program at embbed devices,so aot is aot is really important for me,if not support aot,it will slow use classic interpreter

@lum1n0us
Copy link
Collaborator

Is there a way, like some command line options, for the Kotlin toolchain to compile .kt files to .wasm without utilizing exception handling opcodes?

@ericCHensssssssss
Copy link
Author

ok. goog idea, it can change the kotlin compiler chain .
If i remove exception handling . is AOT support GC feature?

@ericCHensssssssss
Copy link
Author

@lum1n0us Thanks. it worked when i removed the EH,

and how can i run the aot. is the same as wasm file

./iwasm -f test Sys.aot 12

when i run it. error produced

unhandled SIGSEGV, si_addr: 0x53
zsh: abort ./iwasm -f test Sys.aot 12

@ericCHensssssssss
Copy link
Author

ericCHensssssssss commented Feb 17, 2025

sometimes the follow error

./iwasm Sys.aot
unhandled SIGSEGV, si_addr: 0x53
zsh: abort ./iwasm Sys.aot

@ericCHensssssssss
Copy link
Author

ericCHensssssssss commented Feb 19, 2025

when i run the aot file use the follow command
./iwasm Sys.aot
report the error as the screen shot i debug.(rtt_type->type_flag is 0 )
bh_assert(rtt_type->type_flag == WASM_TYPE_STRUCT);

Image

@lum1n0us
Copy link
Collaborator

@ericCHensssssssss would you mind uploading sys.wasm and/or sys.aot?

@chenliuyang1989
Copy link
Contributor

The type_idx is fixed after[https://github.com//pull/4094]

but meet new error
./iwasm -f test aqaraSys.aot
Exception: null function reference

压缩.zip
aotfile.zip

@ericCHensssssssss
Copy link
Author

ericCHensssssssss commented Feb 24, 2025

Hava you find anything new?

@lum1n0us
Copy link
Collaborator

I'm using the latest commit d9c01b3 from the main branch.

I compiled iwasm with the flag -DWAMR_BUILD_GC=1.
When running it with a larger garbage collection heap size, like --gc-heap-size=1073741824, I received endless output. Is this the expected behavior?

$ ./build/iwasm --gc-heap-size=1073741824   -f test   ./aqaraSys-wasm-wasi.wasm

...
this is debug message: before propagate:out - AStatusNumeric,value:0.11333333333333334 {Status.ok}
没有link,links大小:1.开始传递至父节点,p:out,v:0.11333333333333334 {Status.ok}
this is debug message: before propagate:_value - ADouble,value:0.11333333333333334
没有link,links大小:0.开始传递至父节点,p:_value,v:0.11333333333333334
working值变更了,name:Ramp$288$29,working:0.11333333333333334 {Status.ok},out:0.10666666666666667 {Status.ok}
this is debug message: before propagate:_value - ADouble,value:0.10666666666666667
没有link,links大小:0.开始传递至父节点,p:_value,v:0.10666666666666667
this is debug message: before propagate:out - AStatusNumeric,value:0.11333333333333334 {Status.ok}
没有link,links大小:1.开始传递至父节点,p:out,v:0.11333333333333334 {Status.ok}
this is debug message: before propagate:_value - ADouble,value:0.11333333333333334
没有link,links大小:0.开始传递至父节点,p:_value,v:0.11333333333333334
working值变更了,name:Ramp$289$29,working:0.11333333333333334 {Status.ok},out:0.10666666666666667 {Status.ok}
this is debug message: before propagate:_value - ADouble,value:0.10666666666666667
没有link,links大小:0.开始传递至父节点,p:_value,v:0.10666666666666667
this is debug message: before propagate:out - AStatusNumeric,value:0.11333333333333334 {Status.ok}
没有link,links大小:1.开始传递至父节点,p:out,v:0.11333333333333334 {Status.ok}
this is debug message: before propagate:_value - ADouble,value:0.11333333333333334
没有link,links大小:0.开始传递至父节点,p:_value,v:0.11333333333333334
working值变更了,name:Ramp$2810$29,working:0.11333333333333334 {Status.ok},out:0.10666666666666667 {Status.ok}
this is debug message: before propagate:_value - ADouble,value:0.10666666666666667
没有link,links大小:0.开始传递至父节点,p:_value,v:0.10666666666666667
this is debug message: before propagate:out - AStatusNumeric,value:0.11333333333333334 {Status.ok}
没有link,links大小:1.开始传递至父节点,p:out,v:0.11333333333333334 {Status.ok}

@chenliuyang1989
Copy link
Contributor

yes, this is expected behavior. wasm worked as expect

@chenliuyang1989
Copy link
Contributor

do you produce the null function reference error when run aot file?

@ericCHensssssssss
Copy link
Author

@lum1n0us i am blocked ,did you Have some new findings?

@lum1n0us
Copy link
Collaborator

do you produce the null function reference error when run aot file?

No. I can't reproduce the issue with the commit d9c01b3 from the main branch.

@chenliuyang1989
Copy link
Contributor

you can run the aot file with no exception?

This is the my os
Linux VM-16-15-ubuntu 5.15.0-119-generic #129-Ubuntu SMP Fri Aug 2 19:25:20 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

i meet the follow error.
#00: 0x8e906 - $f1616
#1: 0x10c90d - myTest

Exception: null function reference test

what more logs need i provide please let me know,Thanks

@chenliuyang1989
Copy link
Contributor

@lum1n0us can you produce new error when run the aot? or do you need some more logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants