[Dynamic Instrumentation] Add NullByRefArgAndLocal test#7987
[Dynamic Instrumentation] Add NullByRefArgAndLocal test#7987dudikeleti merged 2 commits intomasterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7987) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (69ms) : 67, 70
master - mean (68ms) : 67, 70
section Bailout
This PR (7987) - mean (73ms) : 71, 74
master - mean (72ms) : 71, 73
section CallTarget+Inlining+NGEN
This PR (7987) - mean (1,019ms) : 944, 1093
master - mean (1,005ms) : 947, 1063
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (107ms) : 104, 110
master - mean (106ms) : 103, 108
section Bailout
This PR (7987) - mean (108ms) : 106, 109
master - mean (107ms) : 105, 108
section CallTarget+Inlining+NGEN
This PR (7987) - mean (751ms) : 707, 794
master - mean (741ms) : 689, 793
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (95ms) : 93, 97
master - mean (94ms) : 92, 96
section Bailout
This PR (7987) - mean (95ms) : 94, 96
master - mean (94ms) : 93, 96
section CallTarget+Inlining+NGEN
This PR (7987) - mean (721ms) : 683, 759
master - mean (715ms) : 679, 751
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (99ms) : 90, 107
master - mean (92ms) : 90, 94
section Bailout
This PR (7987) - mean (96ms) : 94, 98
master - mean (93ms) : 92, 94
section CallTarget+Inlining+NGEN
This PR (7987) - mean (655ms) : 619, 691
master - mean (633ms) : 619, 648
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (198ms) : 193, 204
master - mean (201ms) : 193, 210
section Bailout
This PR (7987) - mean (201ms) : 196, 205
master - mean (202ms) : 195, 209
section CallTarget+Inlining+NGEN
This PR (7987) - mean (1,138ms) : 1069, 1208
master - mean (1,136ms) : 1086, 1187
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (281ms) : 274, 287
master - mean (282ms) : 273, 291
section Bailout
This PR (7987) - mean (280ms) : 274, 287
master - mean (282ms) : 273, 292
section CallTarget+Inlining+NGEN
This PR (7987) - mean (939ms) : 904, 974
master - mean (944ms) : 908, 980
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (274ms) : 267, 280
master - mean (272ms) : 265, 279
section Bailout
This PR (7987) - mean (272ms) : 269, 276
master - mean (273ms) : 267, 278
section CallTarget+Inlining+NGEN
This PR (7987) - mean (927ms) : 878, 976
master - mean (931ms) : 877, 986
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7987) - mean (272ms) : 267, 278
master - mean (273ms) : 266, 279
section Bailout
This PR (7987) - mean (273ms) : 268, 278
master - mean (272ms) : 269, 276
section CallTarget+Inlining+NGEN
This PR (7987) - mean (842ms) : 819, 866
master - mean (840ms) : 819, 861
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BenchmarksBenchmark execution time: 2025-12-20 13:09:59 Comparing candidate commit 1660d1e in PR branch Found 10 performance improvements and 4 performance regressions! Performance is the same for 158 metrics, 14 unstable metrics. scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net6.0
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0
scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1
scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1
scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net6.0
scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1
|
1660d1e to
3ca992d
Compare
## Reason for change In some cases, we cannot rely on the method metadata to determine whether method arguments and locals exist, as they may still be skipped. ## Implementation details Track open nodes and open/close them as required. ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. #7986 #7989
…7989) ## Summary of changes Add defensive checks for open nodes before closing them, and delay writing `noCaptureReason` until we are certain that the array node is closed. ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. Related PRs: #7986 #7988
…l and LogArg to detect null byrefs (#7986) ## Reason for change Some methods can legitimately produce null managed byrefs (e.g., MemoryMarshal.GetReference(emptySpan)), which makes ref T point to address 0. Attempting to capture such locals/args would dereference an invalid reference and could crash in LogLocal/LogArg (NullReferenceException). This change makes DI runs stable and keeps probes installed while avoiding unsafe dereferences ## Implementation details Before reading a ref T capture input, we check Unsafe.IsNullRef(ref value) and return early to avoid dereferencing an invalid reference. Current behavior is to skip capturing that member entirely (no misleading null value for non-nullable types like byte). Follow-up option: if we decide we want the snapshot to explicitly show this case, we can reuse the existing snapshot notCapturedReason mechanism (no new reason added in this PR). ## Test coverage #7987 ## Other details This PR is part of an effort to make the Snapshot Exploration Test run successfully end-to-end. #7988 #7989
Summary of changes
Add a new test that uncovers two bugs:
Implementation details
When a null address is passed to our debugger invoker classes, it must be handled explicitly by checking
Unsafe.IsNullRef.Other details
The test is currently skipped and will be enabled once the following PRs are merged:
#7986
#7988
#7989