Skip to content

[wasm] Fix Environment.StackTrace on WASM - #20156

Closed
thaystg wants to merge 1 commit into
mono:masterfrom
thaystg:thays_fix_39341_39223
Closed

thaystg wants to merge 1 commit into
mono:masterfrom
thaystg:thays_fix_39341_39223

Conversation

@thaystg

@thaystg thaystg commented Jul 23, 2020

Copy link
Copy Markdown
Contributor

Don't try to use get_unwind_backtrace because _Unwind_Backtrace is not available on wasm.

Fixes dotnet/runtime#39223
Fixes dotnet/runtime#39341

@thaystg
thaystg requested review from lewing and vargaz July 23, 2020 20:52
@thaystg
thaystg requested a review from BrzVlad as a code owner July 23, 2020 20:52
@lewing

lewing commented Jul 23, 2020

Copy link
Copy Markdown
Member

I assume this also fixes dotnet/runtime#38627

@lewing lewing left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ves_icall_get_frame_info is called directly from https://github.com/dotnet/runtime/blob/master/src/mono/netcore/System.Private.CoreLib/src/System/Diagnostics/StackFrame.Mono.cs#L51 and mono_llvm_only is true in the wasm interpreter case so this looks good to me but I'll let @vargaz follow up

@vargaz

vargaz commented Jul 24, 2020

Copy link
Copy Markdown
Contributor

#20159

@lewing

lewing commented Jul 27, 2020

Copy link
Copy Markdown
Member

We'll probably hit this case in mixed mode in the future, what are our options here?

@thaystg

thaystg commented Jul 27, 2020

Copy link
Copy Markdown
Contributor Author

I think that we can add the ifdef as it's on this other function

#ifndef TARGET_WASM
that uses get_unwind_backtrace.

@vargaz

vargaz commented Jul 27, 2020

Copy link
Copy Markdown
Contributor

Not much, it's not going to work, wasm has no real stack trace api.

@lewing

lewing commented Jul 27, 2020

Copy link
Copy Markdown
Member

We could in theory poke into js and get the stack from there though right?

@vargaz

vargaz commented Jul 27, 2020

Copy link
Copy Markdown
Contributor

emscripten has some functionality which can decompile the wasm binary to get the method id -> method name mapping at runtime, and you can get wasm method ids from a js stacktrace, so something is possible.

@thaystg

thaystg commented Jul 27, 2020

Copy link
Copy Markdown
Contributor Author

Should I try to do something about it right now?

@lewing

lewing commented Jul 27, 2020 •

Copy link
Copy Markdown
Member

no, for now I think we should just open an issue with the idea to revisit it for 6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ExceptionDispatchInfo.SetCurrentStackTrace doesn't include method in stack trace in WASM Tests that read Environment.StackTrace don't work on WASM

3 participants