Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Usage of GHC.Conc.par leads to unreachable error #653

Closed
gkaracha opened this issue May 18, 2020 · 1 comment · Fixed by #656
Closed

Usage of GHC.Conc.par leads to unreachable error #653

gkaracha opened this issue May 18, 2020 · 1 comment · Fixed by #656

Comments

@gkaracha
Copy link
Member

Describe the bug

During the development of #639, I noticed that the nofib test shootout/binary-trees fails with

Main: JSException "RuntimeError: unreachable    
    at wasm-function[108]:0x6e91    
    at wasm-function[4070]:0xd77de
    at wasm-function[4071]:0xd780b    
    at Scheduler.tick (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/binary-trees/rts.scheduler.mjs:346:22)    
    at Immediate.<anonymous> (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/binary-trees/rts.scheduler.mjs:381:29)    
    at processImmediate (internal/timers.js:456:21)"

After some tinkering I noticed that if I remove all invocations of GHC.Conc.par in the file, it executes as expected, so I think that this is the culprit.

To Reproduce
Download Main.hs from here, build it with Asterius, and execute using node:

ahc-link  --ghc-option=-O2 --ghc-option=-Rghc-timing --ghc-option=-H32m --ghc-option=-rtsopts --ghc-option=-funbox-strict-fields --input-hs Main.hs
node Main.mjs 15 11

Expected behavior
The program should execute without errors. The expected stdout can be found here.

Environment

  • OS name + version: Ubuntu 18.04.4 LTS (bionic)
  • GHC version: 8.8.3
  • Cabal version: 3.2.0.0
  • Version of Asterius: 42d5be0
@gkaracha
Copy link
Member Author

Linking with --verbose-err gives a little more info:

Main: JSException "RuntimeError: barf: newSpark    
    at ExceptionHelper.barf (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/binary-trees/rts.exception.mjs:147:13)    
    at barf (wasm-function[184]:0x9c55)    
    at Main_.Lr7z8_entry (wasm-function[108]:0x6eb7)    
    at scheduleTSO (wasm-function[4075]:0xd7aa5)    
    at scheduleTSO_wrapper (wasm-function[4076]:0xd7ad2)    
    at Scheduler.tick (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/binary-trees/rts.scheduler.mjs:346:22)    
    at Immediate.<anonymous> (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/binary-trees/rts.scheduler.mjs:381:29)    
    at processImmediate (internal/timers.js:456:21)"

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

Successfully merging a pull request may close this issue.

1 participant