Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support modules larger than 1 MiB #14

Closed
wants to merge 1 commit into from

Conversation

nanotech
Copy link

While working on an OpenFL project, I started getting a runtime launch error from Neko after adding some new dependencies (Uncaught exception - std@module_read). I traced this down to neko_read_module rejecting any modules with a m->codesize larger than 0xFFFFF (1MiB).

In addition, the current function table encoding doesn't leave enough space to refer to functions farther than 0xFFFFFF bytes (15 MiB) away.

Of course these limits are probably here for a reason that I don't understand yet. Testing seems to confirm this with some large modules still not working, now just aborting silently with a misleadingly clean exit code of zero.

The modules that do work with the limits removed were very small originally; I just linked in some extra modules to increase their size (mainly: nape). I suspect that this works because the code above 1 MiB is never actually run.

For completeness, here is a patch to haxe and to the ocamllibs to output the modified bytecode for this patch.

tl;dr this patch is incomplete, what else need to change?

The initial guard limited the codesize to 1 MiB,
but the global function table would still work
up to 15 MiB.

ABI 2 Neko cannot read ABI 3, but ABI 3 Neko can
still read ABI 2.
@Simn
Copy link
Member

Simn commented Feb 14, 2014

See 33a9a46

@Simn Simn closed this Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants