Closed andrewlock closed 2 months ago
Branch report: andrew/dlsym-hotfix-v3
Commit report: 4fbd8a5
Test service: dd-trace-dotnet
:white_check_mark: 0 Failed, 368261 Passed, 2368 Skipped, 16h 33m 50.74s Total Time :hourglass: 1 Performance Regression
StartStopWithChild
- Benchmarks.Trace.ActivityBenchmark
16.92µs (+929ns, +6%) - DetailsExecution-time results for samples comparing the following branches/commits:
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 shown 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).
gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6049) - mean (70ms) : 66, 74
. : milestone, 70,
master - mean (70ms) : 66, 74
. : milestone, 70,
section CallTarget+Inlining+NGEN
This PR (6049) - mean (1,110ms) : 1081, 1139
. : milestone, 1110,
master - mean (1,119ms) : 1092, 1145
. : milestone, 1119,
gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6049) - mean (109ms) : 105, 112
. : milestone, 109,
master - mean (108ms) : 105, 112
. : milestone, 108,
section CallTarget+Inlining+NGEN
This PR (6049) - mean (798ms) : 776, 821
. : milestone, 798,
master - mean (809ms) : 792, 827
. : milestone, 809,
gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6049) - mean (92ms) : 89, 96
. : milestone, 92,
master - mean (91ms) : 89, 94
. : milestone, 91,
section CallTarget+Inlining+NGEN
This PR (6049) - mean (752ms) : 725, 779
. : milestone, 752,
master - mean (761ms) : 739, 783
. : milestone, 761,
gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6049) - mean (192ms) : 188, 195
. : milestone, 192,
master - mean (192ms) : 186, 198
. : milestone, 192,
section CallTarget+Inlining+NGEN
This PR (6049) - mean (1,199ms) : 1174, 1224
. : milestone, 1199,
master - mean (1,201ms) : 1175, 1228
. : milestone, 1201,
gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6049) - mean (277ms) : 274, 281
. : milestone, 277,
master - mean (278ms) : 273, 282
. : milestone, 278,
section CallTarget+Inlining+NGEN
This PR (6049) - mean (966ms) : 942, 990
. : milestone, 966,
master - mean (968ms) : 947, 988
. : milestone, 968,
gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat X
axisFormat %s
todayMarker off
section Baseline
This PR (6049) - mean (266ms) : 262, 270
. : milestone, 266,
master - mean (266ms) : 261, 271
. : milestone, 266,
section CallTarget+Inlining+NGEN
This PR (6049) - mean (946ms) : 922, 970
. : milestone, 946,
master - mean (945ms) : 917, 973
. : milestone, 945,
Summary of changes
This PR addresses the issue https://github.com/DataDog/dd-trace-dotnet/issues/6045
Reason for change
When using the
dlsym
function, the compiler adds in the import symbols table that we need thedlsym
symbol. Before being a universal binary (same binary used for glibc-based linux and musl-libc-based linux) and the compiler added in aDT_NEEDED
section the librarylibdl.so
(the library containingdlsym
). When the wrapper is loaded, it will look through all theDT_NEEDED
sections to find a library that contains thedlsym
symbol. Since being a universal binary, theDT_NEEDED
sections are removed (part of being universal) and we have to resolve by hand needed symbols (dlsym
,pthread_once
..). If we usedlsym
(or other symbol), we will hit this issue.Implementation details
__dd_dlsym
insteadTest coverage
Added a snapshot test using
nm
that verifies that the undefined symbols in the universal binary haven't changed. It's equivalent to runningbut done using Nuke instead. It would probably make sense for this to be a "normal" test in the native tests, but given it has a dependency on
nm
, which is definitely available in the universal build dockerfile it was quicker and easier to get this up and running directly. When it fails, it prints the diff and throws an exception, e.g.Other details
This is a hotfix for
6048