Skip to content

ExceptionDispatchInfo.SetCurrentStackTrace doesn't include method in stack trace in WASM #39341

Closed

Description

@safern
Exception e;

 e = new Exception();
ABCDEFGHIJKLMNOPQRSTUVWXYZ(e);
Assert.Contains(nameof(ABCDEFGHIJKLMNOPQRSTUVWXYZ), e.StackTrace);

[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private static void ABCDEFGHIJKLMNOPQRSTUVWXYZ(Exception e)
{
    Assert.Same(e, ExceptionDispatchInfo.SetCurrentStackTrace(e));
}

This would fail in Assert.Contains because the StackTrace only contains this line:

sb.AppendLine(SR.Exception_EndStackTraceFromPreviousThrow);

It seems like this line is effectively returning empty:

new StackTrace(fNeedFileInfo: true).ToString(Diagnostics.StackTrace.TraceFormat.TrailingNewLine, sb);

cc: @steveisok @marek-safar @akoeplinger

Activity

  1. added
    arch-wasm
    on Jul 15, 2020
  2. changed the title [-]ExceptionDispatchInfo.SetCurrentStackTrace doesn't contain method in stack trace in WASM[/-] [+]ExceptionDispatchInfo.SetCurrentStackTrace doesn't include method in stack trace in WASM[/+] on Jul 15, 2020
  3. akoeplinger commented on Jul 15, 2020

    @akoeplinger
    Member

    Looks like a variation of #39223

  4. added
    untriaged
    on Jul 17, 2020
  5. self-assigned this
    on Jul 23, 2020
  6. removed
    untriaged
    on Jul 29, 2020
  7. added this to the 5.0.0 milestone on Jul 29, 2020
  8. lewing commented on Jul 31, 2020

    @lewing
    Member

    Fixed in #40031

  9. ghost locked as resolved and limited conversation to collaborators on Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-VM-meta-mono

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions