-
While trying to learn Virgil, I've generated a .wasm with unreachable code and am interested in getting tips on how to debug this. To recreate, you first need the Extism CLI: $ ./build.sh
...
$ ./run.sh
+ extism call greet/Greet.wasm greet --wasi --input Benjamin
Hello, Benjamin!
+ extism call count-vowels/CountVowels.wasm count_vowels --wasi --input 'Once upon a dream'
{"count":7,"total":7,"vowels":"aeiouAEIOU"}
+ extism call http-get/HttpGet.wasm http_get --wasi '--allow-host=*.typicode.com'
Error: wasm error: unreachable
wasm stack trace:
.$40(i32,i32,i32,i32) i32
.$31(i32,i32,i32) i32
.$20(i32) i32
.$14(i32,i32) i32
.$10() i32 I've used |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
One thing is to add |
Beta Was this translation helpful? Give feedback.
-
That was the key, @titzer - thank you! Next question - now that I've got all 3 example Extism plugins working, are you interested in a PR into your main repo, or would you like me to keep my Extism Virgil PDK separate in my own fork? |
Beta Was this translation helpful? Give feedback.
One thing is to add
-symbols
when compiling; that will give you source-level function names. The Wasm target doesn't have source lines yet, a stacktrace with just function names is the best you can do for now. Anyunreachable
that you hit is going to be a safety check or an out-of-memory, so look for places where aNullCheckException
or aBoundsCheckException
, etc could be triggered.