Skip to content

[crashtracker] Improve crashtracker message#8182

Open
gleocadie wants to merge 8 commits intomasterfrom
gleocadie/pass-native-exception-code
Open

[crashtracker] Improve crashtracker message#8182
gleocadie wants to merge 8 commits intomasterfrom
gleocadie/pass-native-exception-code

Conversation

@gleocadie
Copy link
Collaborator

@gleocadie gleocadie commented Feb 10, 2026

Summary of changes

Improve crash reports message.

Reason for change

Today, error message in crash report is handled by the backend: it uses the exception type and message from metadata to build the message.
image

But in case of a native crash (mainly windows), we do not have much information:
image
On linux, we do not propagate the the signal code:
image

The goal of this PR is to collect meaningful information at crash time to generate a (as much as we can) useful error message:

  • Move the exception-based error message from backend to the crashtracker
  • Windows, get the actual native exception
  • Linux, get the signal code

Implementation details

  • Windows native exception code: in the WER callback, get the native exception and pass it to our homemade createdump using --dd-native-exception-code command-line argument
  • Linux: Use the --code command-line argument

Test coverage

Updating the tests.

Other details

@gleocadie gleocadie force-pushed the gleocadie/pass-native-exception-code branch from 79adda6 to 8f97ee8 Compare February 10, 2026 12:55
@pr-commenter
Copy link

pr-commenter bot commented Feb 10, 2026

Benchmarks

Benchmark execution time: 2026-02-19 16:39:02

Comparing candidate commit f318749 in PR branch gleocadie/pass-native-exception-code with baseline commit 8941a2d in branch master.

Found 7 performance improvements and 13 performance regressions! Performance is the same for 156 metrics, 16 unstable metrics.

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟥 execution_time [+10.446ms; +15.793ms] or [+5.301%; +8.015%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody netcoreapp3.1

  • 🟩 execution_time [-20.042ms; -13.687ms] or [-9.317%; -6.363%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472

  • 🟥 throughput [-13560.394op/s; -13099.808op/s] or [-9.219%; -8.906%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟥 execution_time [+23.870ms; +24.336ms] or [+13.204%; +13.462%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟥 execution_time [+98.782ms; +100.777ms] or [+103.298%; +105.384%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+32.575ms; +37.173ms] or [+17.470%; +19.935%]
  • 🟥 throughput [-200.597op/s; -177.580op/s] or [-16.697%; -14.781%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+15.921ms; +17.620ms] or [+11.304%; +12.510%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472

  • 🟥 execution_time [+96.131µs; +100.442µs] or [+5.019%; +5.244%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0

  • 🟥 execution_time [+130.552µs; +137.141µs] or [+9.323%; +9.794%]
  • 🟥 throughput [-63.789op/s; -60.812op/s] or [-8.932%; -8.516%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0

  • 🟥 execution_time [+108.191µs; +111.983µs] or [+9.915%; +10.263%]
  • 🟥 throughput [-85.536op/s; -82.455op/s] or [-9.333%; -8.997%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟩 execution_time [-21.174ms; -17.820ms] or [-10.063%; -8.469%]

scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472

  • 🟥 throughput [-15101.523op/s; -13464.117op/s] or [-5.908%; -5.267%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟩 throughput [+236.796op/s; +415.193op/s] or [+12.722%; +22.306%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟩 throughput [+1169.662op/s; +2881.989op/s] or [+5.698%; +14.040%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟩 throughput [+9009.681op/s; +10877.495op/s] or [+5.296%; +6.394%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟩 execution_time [-44.469ms; -37.969ms] or [-35.611%; -30.406%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟩 throughput [+18202969.906op/s; +19187125.064op/s] or [+8.079%; +8.516%]

@gleocadie gleocadie force-pushed the gleocadie/pass-native-exception-code branch 3 times, most recently from 02ee11d to fbe0535 Compare February 10, 2026 16:51
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Feb 10, 2026

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8182) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration68.90 ± (68.91 - 69.15) ms69.00 ± (69.09 - 69.41) ms+0.1%✅⬆️
.NET Framework 4.8 - Bailout
duration73.05 ± (72.96 - 73.31) ms72.98 ± (72.87 - 73.20) ms-0.1%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1037.82 ± (1042.59 - 1052.44) ms1033.20 ± (1035.29 - 1040.97) ms-0.4%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.37 ± (22.35 - 22.40) ms22.36 ± (22.33 - 22.39) ms-0.0%
process.time_to_main_ms86.93 ± (86.78 - 87.08) ms87.45 ± (87.28 - 87.62) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.45 ± (15.44 - 15.45) MB15.47 ± (15.47 - 15.48) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.36 ± (22.34 - 22.39) ms22.36 ± (22.34 - 22.39) ms+0.0%✅⬆️
process.time_to_main_ms88.00 ± (87.87 - 88.13) ms88.30 ± (88.19 - 88.42) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.49 ± (15.49 - 15.50) MB15.50 ± (15.50 - 15.50) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms261.11 ± (258.42 - 263.80) ms256.86 ± (253.54 - 260.18) ms-1.6%
process.time_to_main_ms492.62 ± (492.09 - 493.15) ms493.93 ± (493.41 - 494.46) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.15 ± (52.13 - 52.18) MB52.10 ± (52.08 - 52.12) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.0%
.NET 6 - Baseline
process.internal_duration_ms21.09 ± (21.07 - 21.12) ms21.22 ± (21.18 - 21.25) ms+0.6%✅⬆️
process.time_to_main_ms75.24 ± (75.09 - 75.38) ms75.56 ± (75.44 - 75.68) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.17 ± (15.16 - 15.17) MB15.18 ± (15.18 - 15.18) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.04 ± (21.01 - 21.06) ms21.12 ± (21.09 - 21.14) ms+0.4%✅⬆️
process.time_to_main_ms75.97 ± (75.89 - 76.05) ms76.77 ± (76.66 - 76.87) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed15.29 ± (15.28 - 15.29) MB15.30 ± (15.29 - 15.30) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms257.30 ± (256.65 - 257.94) ms257.73 ± (257.01 - 258.46) ms+0.2%✅⬆️
process.time_to_main_ms473.21 ± (472.66 - 473.76) ms471.61 ± (471.11 - 472.11) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed53.02 ± (52.99 - 53.04) MB52.99 ± (52.96 - 53.01) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.3%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms18.82 ± (18.79 - 18.84) ms18.97 ± (18.94 - 19.00) ms+0.8%✅⬆️
process.time_to_main_ms68.11 ± (68.00 - 68.22) ms68.39 ± (68.26 - 68.51) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.69) MB7.68 ± (7.67 - 7.69) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.79 ± (18.76 - 18.81) ms19.02 ± (18.99 - 19.05) ms+1.2%✅⬆️
process.time_to_main_ms69.36 ± (69.25 - 69.46) ms69.73 ± (69.59 - 69.88) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.76 ± (7.75 - 7.77) MB7.74 ± (7.73 - 7.75) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms180.32 ± (179.54 - 181.10) ms179.42 ± (178.54 - 180.31) ms-0.5%
process.time_to_main_ms427.87 ± (427.29 - 428.44) ms429.02 ± (428.52 - 429.53) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed35.95 ± (35.92 - 35.97) MB35.97 ± (35.94 - 36.00) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.1%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration191.09 ± (191.13 - 191.83) ms192.29 ± (192.26 - 193.17) ms+0.6%✅⬆️
.NET Framework 4.8 - Bailout
duration195.16 ± (195.02 - 195.63) ms195.44 ± (195.38 - 196.06) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1130.03 ± (1131.85 - 1137.77) ms1141.22 ± (1143.40 - 1151.17) ms+1.0%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms190.21 ± (189.85 - 190.58) ms190.81 ± (190.39 - 191.23) ms+0.3%✅⬆️
process.time_to_main_ms87.90 ± (87.71 - 88.10) ms88.08 ± (87.86 - 88.29) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed20.62 ± (20.60 - 20.65) MB20.64 ± (20.62 - 20.67) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 20)20 ± (20 - 20)+0.8%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms190.29 ± (189.98 - 190.60) ms191.58 ± (191.25 - 191.92) ms+0.7%✅⬆️
process.time_to_main_ms88.88 ± (88.73 - 89.03) ms89.40 ± (89.22 - 89.57) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed20.68 ± (20.65 - 20.72) MB20.73 ± (20.71 - 20.76) MB+0.2%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.5%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms437.07 ± (433.92 - 440.21) ms439.88 ± (436.94 - 442.83) ms+0.6%✅⬆️
process.time_to_main_ms494.38 ± (493.80 - 494.95) ms495.17 ± (494.65 - 495.70) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.64 ± (62.53 - 62.75) MB62.61 ± (62.49 - 62.72) MB-0.1%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.1%
.NET 6 - Baseline
process.internal_duration_ms190.77 ± (190.52 - 191.02) ms190.83 ± (190.48 - 191.19) ms+0.0%✅⬆️
process.time_to_main_ms69.58 ± (69.44 - 69.71) ms70.00 ± (69.81 - 70.20) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.97 ± (15.81 - 16.12) MB16.29 ± (16.18 - 16.40) MB+2.0%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)19 ± (19 - 19)+4.0%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms190.30 ± (189.90 - 190.70) ms189.80 ± (189.51 - 190.09) ms-0.3%
process.time_to_main_ms70.79 ± (70.69 - 70.90) ms70.72 ± (70.62 - 70.82) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.13 ± (15.98 - 16.29) MB16.21 ± (16.07 - 16.35) MB+0.5%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.9%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms448.12 ± (446.02 - 450.21) ms445.11 ± (442.83 - 447.38) ms-0.7%
process.time_to_main_ms446.00 ± (445.51 - 446.49) ms446.00 ± (445.59 - 446.42) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.14 ± (58.04 - 58.25) MB58.16 ± (58.06 - 58.26) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms193.01 ± (192.62 - 193.41) ms192.66 ± (192.31 - 193.01) ms-0.2%
process.time_to_main_ms75.93 ± (75.73 - 76.14) ms75.43 ± (75.23 - 75.62) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.31 ± (16.29 - 16.34) MB16.27 ± (16.25 - 16.29) MB-0.2%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.2%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms191.78 ± (191.48 - 192.08) ms191.45 ± (191.14 - 191.77) ms-0.2%
process.time_to_main_ms76.87 ± (76.75 - 76.99) ms76.37 ± (76.24 - 76.51) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.41 ± (16.39 - 16.44) MB16.41 ± (16.38 - 16.43) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.6%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.37 ± (367.93 - 370.81) ms372.19 ± (370.83 - 373.56) ms+0.8%✅⬆️
process.time_to_main_ms454.16 ± (453.41 - 454.90) ms454.86 ± (454.28 - 455.43) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed52.30 ± (52.25 - 52.34) MB52.28 ± (52.24 - 52.32) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
Comparison explanation

Execution-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:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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 charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8182) - mean (69ms)  : 67, 72
    master - mean (69ms)  : 67, 71

    section Bailout
    This PR (8182) - mean (73ms)  : 71, 75
    master - mean (73ms)  : 71, 75

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (1,038ms)  : 998, 1079
    master - mean (1,048ms)  : 976, 1119

Loading
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 (8182) - mean (116ms)  : 114, 118
    master - mean (115ms)  : 112, 119

    section Bailout
    This PR (8182) - mean (117ms)  : 115, 118
    master - mean (116ms)  : 115, 118

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (775ms)  : 711, 839
    master - mean (781ms)  : 741, 820

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8182) - mean (102ms)  : 99, 105
    master - mean (102ms)  : 99, 104

    section Bailout
    This PR (8182) - mean (104ms)  : 102, 105
    master - mean (103ms)  : 101, 104

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (765ms)  : 744, 786
    master - mean (759ms)  : 738, 781

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8182) - mean (94ms)  : 91, 97
    master - mean (93ms)  : 91, 96

    section Bailout
    This PR (8182) - mean (95ms)  : 93, 97
    master - mean (95ms)  : 93, 96

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (637ms)  : 620, 654
    master - mean (634ms)  : 622, 647

Loading
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 (8182) - mean (193ms)  : 188, 197
    master - mean (191ms)  : 188, 195

    section Bailout
    This PR (8182) - mean (196ms)  : 192, 199
    master - mean (195ms)  : 192, 198

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (1,147ms)  : 1092, 1203
    master - mean (1,135ms)  : 1093, 1177

Loading
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 (8182) - mean (287ms)  : 282, 293
    master - mean (287ms)  : 282, 293

    section Bailout
    This PR (8182) - mean (290ms)  : 286, 294
    master - mean (288ms)  : 282, 293

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (968ms)  : 918, 1017
    master - mean (963ms)  : 914, 1013

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8182) - mean (269ms)  : 263, 274
    master - mean (269ms)  : 265, 273

    section Bailout
    This PR (8182) - mean (268ms)  : 265, 272
    master - mean (269ms)  : 264, 275

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (920ms)  : 883, 956
    master - mean (924ms)  : 896, 951

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8182) - mean (278ms)  : 272, 284
    master - mean (279ms)  : 272, 286

    section Bailout
    This PR (8182) - mean (278ms)  : 273, 282
    master - mean (279ms)  : 275, 282

    section CallTarget+Inlining+NGEN
    This PR (8182) - mean (859ms)  : 841, 877
    master - mean (857ms)  : 837, 877

Loading

@gleocadie gleocadie force-pushed the gleocadie/pass-native-exception-code branch 7 times, most recently from 3474da7 to 6f2798e Compare February 16, 2026 09:13
@gleocadie gleocadie marked this pull request as ready for review February 17, 2026 08:10
@gleocadie gleocadie requested review from a team as code owners February 17, 2026 08:10
Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

std::pair<ddog_crasht_SignalNames, ddog_crasht_SiCodes> GetSignalInfo(int32_t signal, int32_t code)
{
// Linux signal numbers -> ddog_crasht_SignalNames (see man 7 signal, CreatedumpCommand.cs GetSignalInfo)
ddog_crasht_SignalNames signo = DDOG_CRASHT_SIGNAL_NAMES_UNKNOWN;
Copy link
Member

Choose a reason for hiding this comment

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

As I understand it, these signal codes are can be different on different platforms? 😅 https://man7.org/linux/man-pages/man7/signal.7.html#:~:text=Signal%20numbering%20for%20standard%20signals

We're mostly OK, but IIRC, mac is different for one of them too? 😅 Don't know if it's an issue or not for us here 🤷‍♂️

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, crashtracker (nor the profiler) does not work on mac as far as I know (libunwind is unsuable + not sure there a remote unwinding mac version)
But yeah for now we are safe.
And yes, it's PITA the signal codes

signal = signalValue;
}

if (parsedArguments.TryGetValue("--code", out var rawCode) && int.TryParse(rawCode, out var signalCodeValue))
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to validate that the signalCodeValue is actually a valid int? I assume it doesn't really matter, as this is just informational?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in that case, it's mainly informational

/// Maps a Windows native exception code (from EXCEPTION_RECORD.ExceptionCode / WER) to a human-readable name.
/// </summary>
private static string GetExceptionFromNativeCode(uint code) =>
WindowsExceptionCodeNames.TryGetValue(code, out var name) ? name : "Unknown";
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to use the switch expression pattern like you did below? Dictionary allocation seems uneccessary given you only seem to call this here, once?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh good catch, I forgot to update this

29 => "SIGIO",
30 => "SIGPWR",
31 => "SIGSYS",
_ => $"signal {signal}"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_ => $"signal {signal}"
_ => FormattableString.Invariant($"signal {signal}"),

}

private bool SetSignal(ICrashReport crashReport, int signal)
private unsafe bool SetSignal(ICrashReport crashReport, int signal, int? signalCode)
Copy link
Member

Choose a reason for hiding this comment

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

Surely this isn't unsafe due to your changes?? 🤔

Suggested change
private unsafe bool SetSignal(ICrashReport crashReport, int signal, int? signalCode)
private bool SetSignal(ICrashReport crashReport, int signal, int? signalCode)

@gleocadie gleocadie force-pushed the gleocadie/pass-native-exception-code branch from 6d6666d to f318749 Compare February 19, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments