Skip to content

[EH] Stack trace support for Wasm EH #17466

Closed

Description

@aheejin

Currently, both in Emscripten and Wasm EH, if you throw an exception, stack traces are not attached by default. This was, at least for Wasm EH, an intentional decision, because Wasm exception itself can be used not only for errors but for other control flow structures with which slowdown can be problematic. Native C++ exceptions don't have stack traces either.

But it is still convenient to see stack traces when debugging. I think we can attach stack traces when in debug / assert mode, by throwing an Error object instead of a raw string in case of Emscripten EH, and turning the optional traceStack option on in the JS API for Wasm EH.

Related request: #17437

Activity

  1. self-assigned this
    on Jul 18, 2022
  2. aheejin commented on Sep 30, 2022

    @aheejin
    MemberAuthor

    I think I can make this work for Wasm EH, but I'm not sure if the same is possible for Emscripten EH. If we throw a JS Error object in Emscripten EH, that's not going to be recognized as a C++ exception in our wasm code... Maybe we should only solve this for Wasm EH and recommend people to use it more.

  3. changed the title [-][EH] Stack trace support for Emscripten / Wasm EH[/-] [+][EH] Stack trace support for Wasm EH[/+] on Sep 30, 2022
  4. kripken commented on Sep 30, 2022

    @kripken
    Member

    +1 for fixing only in Wasm EH. Even if people can't ship with it yet on all browsers, for local debugging a developer can use a recent browser with Wasm EH.

  5. added a commit that references this issue on Oct 3, 2022
    35f61c9
  6. added a commit that references this issue on Oct 6, 2022
    3e53d5c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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