emscripten-core/emscripten

Source map and offset converter is not loaded or created when providing a custom instantiateWasm function

Open

#9.836 geöffnet am 14. Nov. 2019

Auf GitHub ansehen
 (13 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (3.519 Forks)batch import
good first bughelp wanted

Repository-Metriken

Stars
 (27.361 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 19T 10h) (147 gemergte PRs in 30 T)

Beschreibung

If we provide a custom function for downloading and instantiating the wasm binary we are not getting source map loaded or offset converter created, thus getting stuck at waiting for those runtime dependencies if for example enabling sanitizer.

It looks like when providing this it bails out early https://github.com/emscripten-core/emscripten/blob/6df46b605078ba132821facbfc6d8946c838227e/src/preamble.js#L1094-L1105 and never loads source map which for async is later and for sync is in the instantiator itself. https://github.com/emscripten-core/emscripten/blob/6df46b605078ba132821facbfc6d8946c838227e/src/preamble.js#L1113 https://github.com/emscripten-core/emscripten/blob/6df46b605078ba132821facbfc6d8946c838227e/src/preamble.js#L1086

In addition the offset converter seems to be created only from the built-in instantiations at https://github.com/emscripten-core/emscripten/blob/6df46b605078ba132821facbfc6d8946c838227e/src/preamble.js#L1036-L1047 https://github.com/emscripten-core/emscripten/blob/6df46b605078ba132821facbfc6d8946c838227e/src/preamble.js#L1064-L1073 so these are also skipped when providing the custom function.

Is this intended, or is there a recommended way to go about this currently? There seems to be a few hoops to jump through to set this up from a custom instantiator properly.

Contributor Guide