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

πŸ› Bug Report β€” Runtime APIs: large wasm memory allocations bring a DurableObject into broken state #3264

Open
yarolegovich opened this issue Dec 23, 2024 · 0 comments

Comments

@yarolegovich
Copy link

Details

Reproduction code with steps in README.

We're using automerge library. When we make a large number of allocations a:

Range Error: Invalid typed array length: undefined

Error is thrown in this code produced by wasm-bindgen:

let cachedUint8ArrayMemory0 = null;

function getUint8ArrayMemory0() {
    if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
        cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
    }
    return cachedUint8ArrayMemory0;
}

wasm.memory.buffer is an ArrayBuffer with non-zero byteLength.

The worts part is that after this happens for the first time the object starts failing on any interaction with the library (cause of memory access attempts) and it is hard to get the object out of this state. DurableObject reset by an unhandled exception or this.ctx.abort() doesn't help. Other DurableObjects of the same type are working fine (until overloaded).

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

No branches or pull requests

1 participant