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

Implementation of malloc is missing #654

Description

@gkaracha

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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions