Skip to content

Conversation

@BruceForstall
Copy link
Contributor

Currently, the method context numbers are output for each failure,
but the assert message is output separately, so if there are multiple
asserts that fire, and you want to investigate a particular one,
it's hard to figure out which method context number to use.

Add the method context number to the assert message, so the relationship
between the method context number and the assert is obvious.

E.g., you always get messages like the following (both before this change
and after):

ERROR: Exception thrown: DebugBreak or AV Exception 123
ERROR: main method 16501 of size 286 failed to load and compile correctly.

Before you might see an assert like:

ISSUE: <ASSERT> C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)

Now, it will look like:

ISSUE: <ASSERT> #16501 C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)

Currently, the method context numbers are output for each failure,
but the assert message is output separately, so if there are multiple
asserts that fire, and you want to investigate a particular one,
it's hard to figure out which method context number to use.

Add the method context number to the assert message, so the relationship
between the method context number and the assert is obvious.

E.g., you always get messages like the following (both before this change
and after):
```
ERROR: Exception thrown: DebugBreak or AV Exception 123
ERROR: main method 16501 of size 286 failed to load and compile correctly.
```

Before you might see an assert like:
```
ISSUE: <ASSERT> C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)
```

Now, it will look like:
```
ISSUE: <ASSERT> dotnet#16501 C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)
```
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Dec 30, 2021
@ghost ghost assigned BruceForstall Dec 30, 2021
@ghost
Copy link

ghost commented Dec 30, 2021

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

Issue Details

Currently, the method context numbers are output for each failure,
but the assert message is output separately, so if there are multiple
asserts that fire, and you want to investigate a particular one,
it's hard to figure out which method context number to use.

Add the method context number to the assert message, so the relationship
between the method context number and the assert is obvious.

E.g., you always get messages like the following (both before this change
and after):

ERROR: Exception thrown: DebugBreak or AV Exception 123
ERROR: main method 16501 of size 286 failed to load and compile correctly.

Before you might see an assert like:

ISSUE: <ASSERT> C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)

Now, it will look like:

ISSUE: <ASSERT> #16501 C:\gh\runtime6\src\coreclr\jit\fgbasic.cpp (4699) - Assertion failed '!"unexpected case 1"' in 'CancellationTokenSource:ExecuteCallbackHandlers(bool):this' during 'Update flow graph opt pass' (IL size 286)
Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@BruceForstall
Copy link
Contributor Author

@dotnet/jit-contrib PTAL

@BruceForstall BruceForstall merged commit 260a306 into dotnet:main Dec 31, 2021
@BruceForstall BruceForstall deleted the ImproveSuperPMIAssertMessage branch December 31, 2021 23:58
@ghost ghost locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants