Skip to content

Implement Callback for generic excetions/traps as it is for memory enlarge exceptions #4201

@borjatelladotecnalia

Description

@borjatelladotecnalia

Feature

WAMR allows to define a callback to be triggered whenever a memory enlarge operation happens. I miss the same behaviour with let's call them "generic exceptions" which may include from "wrong version" to "divided by cero" events.

Benefit

Main thread is aware of unexpected events in an asynchronous way

Implementation

As a first approach, replicate structures and logic related to enlarge memory exceptions—originally defined in wam_memory.c/h—within wasm_runtime_common.c/h.

Finally modify wasm_set_exception function to call the configured call back.

Alternatives

Any other approach would be more efficient and practical? Something missing or collateral impact?

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