Skip to content

Commit 556caa4

Browse files
github-actions[bot]thaystglewing
authored
[release/9.0-staging] [mono] Fix crash while debugging AOT'ed app. (#117891)
Backport of #117627 to release/9.0-staging /cc @thaystg ## Customer Impact - [ ] Customer reported - [X] Found internally We initially backported this change to 10, but held off because there were no reported issues with .NET 9. That has changed with https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2604939 where we were able to reproduce the issue. The change fixes a crash in debugger by adding a null check around TLS data before dereferencing a pointer. ## Regression - [ ] Yes - [X] No [If yes, specify when the regression was introduced. Provide the PR or commit if known.] ## Testing Manually tested a default iOS SDK application ## Risk Low **IMPORTANT**: If this backport is for a servicing release, please verify that: - The PR target branch is `release/X.0-staging`, not `release/X.0`. ## Package authoring no longer needed in .NET 9 **IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version. Keep in mind that we still need package authoring in .NET 8 and older versions. Co-authored-by: Thays Grazia <thaystg@gmail.com> Co-authored-by: Larry Ewing <lewing@microsoft.com>
1 parent 3e7bf22 commit 556caa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mono/mono/component/debugger-agent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4124,7 +4124,7 @@ jit_end (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo)
41244124
if (assembly) {
41254125
DebuggerTlsData *tls;
41264126
tls = (DebuggerTlsData *)mono_native_tls_get_value (debugger_tls_id);
4127-
if (!CHECK_ICORDBG (TRUE) || tls->invoke == NULL) {
4127+
if (!CHECK_ICORDBG (TRUE) || !tls || tls->invoke == NULL) {
41284128
process_profiler_event (EVENT_KIND_ASSEMBLY_LOAD, assembly);
41294129
} else {
41304130
mono_dbg_assembly_load (prof, assembly); //send later

0 commit comments

Comments
 (0)