Fails to run when compiled with emscripten for WASM

Open
#455 4 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, wasm
Domain
compilers

Research direction

Start with the sources and binaries linked in the issue, then inspect hlc_main.c around hl_global_init() and reproduce the failure in the Emscripten build. The work is done when the compiled HashLink project runs without the recursion or full-stack exception in a browser.

Written by the indexing model from the issue text.

Description

I've tried compiling Hashlink with emscripten, it compiled with a few adjustments.

When running the project it quickly fails with an exception when it gets to the C part, around hl_global_init() in hlc_main.c: too much recursion or stack is full.

More info with the sources and binaries here
https://github.com/Lerg/hashlink-emscripten

I don't have much experience debugging WASM projects or understanding the underlying of Hashlink, but I hope it can run in a browser with a few fixes.

I need WASM because my work project based on Heaps is too slow when running the plain JS export.

Dominant language
C
Stars
911
Forks
207
Avg merge
1d 21h
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HaxeFoundation/hashlink

All issues in HaxeFoundation/hashlink

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.