Skip to content

Local vs CI: RuntimeError: null function or function signature mismatch #25950

@tdrz

Description

@tdrz

I am one of the maintainers of PGlite - PostgreSQL in WASM.

I have been chasing a RuntimeError that only happens in the CI.

The crash is this:

RuntimeError: null function or function signature mismatch
    at pglite.wasm.MemoryContextAlloc (wasm://wasm/pglite.wasm-095d8682:wasm-function[13757]:0x5673f7)
    at pglite.wasm.LockAcquireExtended (wasm://wasm/pglite.wasm-095d8682:wasm-function[8504]:0x3defb1)
    at pglite.wasm.LockRelationOid (wasm://wasm/pglite.wasm-095d8682:wasm-function[8456]:0x3dd814)
    at pglite.wasm.relation_open (wasm://wasm/pglite.wasm-095d8682:wasm-function[730]:0x9408c)
    at pglite.wasm.table_open (wasm://wasm/pglite.wasm-095d8682:wasm-function[1625]:0xfb235)
    at pglite.wasm.update_attstats (wasm://wasm/pglite.wasm-095d8682:wasm-function[3145]:0x1bac76)
    at pglite.wasm.do_analyze_rel (wasm://wasm/pglite.wasm-095d8682:wasm-function[3139]:0x1ba20a)
    at pglite.wasm.analyze_rel (wasm://wasm/pglite.wasm-095d8682:wasm-function[3137]:0x1b9005)
    at invoke_viiiiii (/home/runner/_work/pglite/pglite/packages/pglite/dist/index.js:3:131071)
    at pglite.wasm.vacuum (wasm://wasm/pglite.wasm-095d8682:wasm-function[3833]:0x24f1c7)

Full CI run can be seen here.

This happens on node 22 and above (node 20 works fine), but only on CI. I cannot reproduce it locally with the same node version(s).

More info
The .wasm is built in a docker container both locally and in CI.
The test passes when running on node 20 even in CI. See this run.

Having looked at https://emscripten.org/docs/porting/Debugging.html and trying to identify the issue without success, I am searching for pointers in how I could reproduce it locally, identify it and possibly fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions