Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm] Use g_printerr to emit errors in mini-wasm.c, so they show up wit… #49838

Merged
merged 3 commits into from
Mar 20, 2021

Conversation

radical
Copy link
Member

@radical radical commented Mar 18, 2021

…h traces in the js console.

With just printf, you would see the error as:

ThreadPool Callback threw an unhandled exception of type System.TypeInitializationException

.. but with g_error, you get:

Screen Shot 2021-03-18 at 4 59 57 PM

You don't get the message string itself, but that can be found by looking at the source line. Or you can build the runtime with /p:MonoEnableAssertMessages=true.

But you do get the stack trace for that error!

@radical radical added the arch-wasm WebAssembly architecture label Mar 18, 2021
@radical radical requested review from lewing, vargaz and kg March 18, 2021 21:59
@ghost
Copy link

ghost commented Mar 18, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

…h traces in the js console.

With just printf, you would see the error as:

ThreadPool Callback threw an unhandled exception of type System.TypeInitializationException

.. but with g_error, you get:

Screen Shot 2021-03-18 at 4 59 57 PM

You don't get the message string itself, but that can be found by looking at the source line. Or you can build the runtime with /p:MonoEnableAssertMessages=true.

But you do get the stack trace for that error!

Author: radical
Assignees: -
Labels:

arch-wasm

Milestone: -

vargaz: printf in JIT code is mapped to the platform logging operation, so this one can stay as it is.
Copy link
Member

@lewing lewing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, stack is more useful than a printf.

  • fix g_assert to print a stack?
  • do something intltool-like and start moving strings to a table we can link in or out at WasmNativeBuild time?

@lambdageek
Copy link
Member

Is the intention here to turn a benign error into a fatal one? g_error aborts the process.

@lewing
Copy link
Member

lewing commented Mar 19, 2021

@lambdageek makes a (very) good point, please use g_printerr like #49828

@radical
Copy link
Member Author

radical commented Mar 19, 2021

Nice, stack is more useful than a printf.

  • fix g_assert to print a stack?

It gets logged with the stack trace, I confirmed.

  • do something intltool-like and start moving strings to a table we can link in or out at WasmNativeBuild time?

#49888

@radical radical changed the title [wasm] Use g_error to emit errors in mini-wasm.c, so they show up wit… [wasm] Use g_printerr to emit errors in mini-wasm.c, so they show up wit… Mar 19, 2021
@lewing lewing merged commit 026b71d into dotnet:main Mar 20, 2021
@radical radical deleted the wasm-use-g-error branch March 20, 2021 00:47
@ghost ghost locked as resolved and limited conversation to collaborators Apr 19, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-VM-meta-mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants