Skip to content

OPFS leaves AccessHandles open when my app crashes #24648

@rickg-hcl

Description

@rickg-hcl

Please include the following in your bug report:

Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.11-git (1e68a1b)
clang version 21.0.0git (https:/github.com/llvm/llvm-project 2f05451198e2f222ec66cec4892ada0509519290)
Target: wasm32-unknown-emscripten
Thread model: posix

I have spent 2 days trying to create a simple test program the reproduces this, but I could not get it to reproduce.

In our very complicated emscripten application, when it crashes, there are access handles left dangling, such that when we restart, the opens fail with:

Failed to execute 'createSyncAccessHandle' on 'FileSystemFileHandle': Access Handles cannot be created if there is another open Access Handle or Writable stream associated with the same file.

reloading the web page does not resolve the issue, we have close the chrome browser to recover.

I will be creating a pull request that adds a function

void wasmfs_close_opfs_backend(backend_t backend);

That I have tested and solves our problem.

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