Currently it's incredibly difficult to debug RTS or code generator issues because the error messages do not help, they simply say "canister trapped". Here's an actual example:
ingress Err: IC0502: Canister 75hes-oqbaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q trapped: heap out of bounds
I previously spent days trying to debug these errors in #1750, and I'm doing the same now in #1931.
If ic-ref showed the trapping instruction's location, as an offset in the Wasm module, that'd help immensely. Some of the bugs that I wasted hours debugging would take a few minutes.
Since we'll be doing more work on the RTS (for garbage collection and probably other stuff too) and code generator I think it makes sense to invest some time into making ic-ref show trapping instruction locations.
I already started hacking on winter for this. This is an issue to keep track of the progress.
Note that the fix for this will be in winter and maybe ic-ref, not in Motoko. I'm creating the issue here as the end goal is to help with Motoko development, but let me know if I should move this to winter's or ic-ref's Github repo.
(We previously briefly discussed this on slack)
Currently it's incredibly difficult to debug RTS or code generator issues because the error messages do not help, they simply say "canister trapped". Here's an actual example:
I previously spent days trying to debug these errors in #1750, and I'm doing the same now in #1931.
If ic-ref showed the trapping instruction's location, as an offset in the Wasm module, that'd help immensely. Some of the bugs that I wasted hours debugging would take a few minutes.
Since we'll be doing more work on the RTS (for garbage collection and probably other stuff too) and code generator I think it makes sense to invest some time into making ic-ref show trapping instruction locations.
I already started hacking on winter for this. This is an issue to keep track of the progress.
Note that the fix for this will be in winter and maybe ic-ref, not in Motoko. I'm creating the issue here as the end goal is to help with Motoko development, but let me know if I should move this to winter's or ic-ref's Github repo.
(We previously briefly discussed this on slack)