Skip to content

Trap versus embedder-specific error #1070

Closed
@jfbastien

Description

@jfbastien

Over in WebAssembly/spec#483 (comment) @rossberg-chromium and I discuss what should generate a trap versus an embedder-specific error.

AFAICT we currently generate traps for corner-cases of specific opcodes:

  • Out-of-bounds accesses
  • Invalid input operands for an arithmetic or conversions operation
  • Signature mismatch
  • Unreachable

We allow generating embedder-specific errors when:

  • A trap is generated
  • Validation fails
  • Compilation fails
  • Linking fails
  • An arbitrary limit is reached in the static binary
  • An arbitrary limit is reached at runtime (such as stack overflow)

@rossberg-chromium's proposed text is:

If the runtime limits of an implementation are exceeded during execution of a computation, then it may terminate that computation by causing a trap or reporting an embedder-specific error to the invoking code.

Generating one or the other seems wrong to me: from my understanding of our design traps don't really fit that purpose.

So what's our approach to traps versus embedder-specific errors? We don't really have a clear approach.

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