asterius icon indicating copy to clipboard operation
asterius copied to clipboard

How to trace the "unreachable" runtime error back to Haskell modules or functions?

Open freedomhero opened this issue 3 years ago • 0 comments

I got a confusing "unreachable" runtime error when using ahc-dist --input-exe xxx --run to run a very complicated Haskell project which got a lot of dependencies.

RuntimeError: unreachable
    at <anonymous>:wasm-function[3155]:0xc2814
    at <anonymous>:wasm-function[7265]:0x1757aa
    at scheduleTSO (<anonymous>:wasm-function[7266]:0x1757d7)
    at Scheduler.tick (file:///workspace/rts.scheduler.mjs:347:22)
    at Immediate.<anonymous> (file:///workspace/rts.scheduler.mjs:382:29)
    at processImmediate (node:internal/timers:463:21)

When "--verbose-err" was added to the command I got log like this, which was also incomprehensible to me.

RuntimeError: barf_signal: ghczuwrapperZC2ZCbaseZCSystemziPosixziInternalsZCSEEKzuCUR
    at ExceptionHelper.barf_signal (file:///workspace/rts.exception.mjs:178:13)
    at base_GHCziIOziFD_zdwzdctell_entry (<anonymous>:wasm-function[3816]:0x115ec5)
    at scheduleTSO (<anonymous>:wasm-function[8774]:0x222488)
    at scheduleTSO_wrapper (<anonymous>:wasm-function[8775]:0x2224bd)
    at Scheduler.tick (file:///workspace/rts.scheduler.mjs:347:22)
    at Immediate.<anonymous> (file:///workspace/rts.scheduler.mjs:382:29)
    at processImmediate (node:internal/timers:463:21)

My question is how can I trace back to haskell to find out which module or function is the cause of the error? Is there any common ways to do this?

freedomhero avatar Sep 22 '22 03:09 freedomhero