Skip to content

Undefined wasmBinaryFile when compiled with SPLIT_MODULE and pthread #27064

@ravisumit33

Description

@ravisumit33

I am trying to introduce multithreading to my codebase where I already use SPLIT_MODULE flag with wasm-split tool. I am using PROXY_TO_PTHREAD flag to call my main function in a pthread. When createWasm is called, it instantiates wasm module in a pthread, which calls getWasmImports(here). When building with SPLIT_MODULE, getWasmImports is defined in terms of splitModuleProxyHandler, which uses wasmBinaryFile(here). But wasmBinaryFile is undefined at this time, hence getting the issue.

I saw that wasmBinaryFile is used as is, if already defined (here), so I have added

self.wasmBinaryFile = self.findWasmBinary();

in my postjs and things worked. I am wondering if it is expected for someone to define wasmBinaryFile this way if integrating both SPLIT_MODULE and pthread together. If yes, this should be documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions