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

Implementation of malloc is missing #654

Closed
gkaracha opened this issue May 18, 2020 · 0 comments · Fixed by #659
Closed

Implementation of malloc is missing #654

gkaracha opened this issue May 18, 2020 · 0 comments · Fixed by #659

Comments

@gkaracha
Copy link
Member

Describe the bug

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

Main: JSException "RuntimeError: barf: malloc    
    at ExceptionHelper.barf (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/n-body/rts.exception.mjs:147:13)    
    at barf (wasm-function[132]:0x7747)    
    at Main_.Lc8NO (wasm-function[41]:0x3ff5)    
    at scheduleTSO (wasm-function[4107]:0xd99a4)    
    at scheduleTSO_wrapper (wasm-function[4108]:0xd99d1)    
    at Scheduler.tick (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/n-body/rts.scheduler.mjs:346:22)    
    at Immediate.<anonymous> (file:///home/skull/tweag/asterius-alt/asterius/nofib/shootout/n-body/rts.scheduler.mjs:381:29)    
    at processImmediate (internal/timers.js:456:21)"

This probably means that we have no working implementation of malloc for node to use.

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=-fexcess-precision --verbose-err --input-hs Main.hs
node Main.mjs 500000

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
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