Skip to content

OOM during std::vector allocation doesn't terminate the program #11042

Closed
@zeux

Description

@zeux

The behavior of code that OOMs right now is odd and unexpected:

  • By default, the error thrown by WebAssembly.memory.grow is caught and swallowed in emscripten_realloc_buffer; some other heap access in the future dies with "out of bounds memory access".

  • When assertions are enabled, an error message is printed to the output but it doesn't halt execution either.

Is there a reason why the exception is being caught here in the first place? It would be good to not do that at least if assertions are disabled, and maybe even if they are enabled (& use finally to log the error instead). This will simplify root cause analysis for OOMs.

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