Commit 1ce0b30
authored
fix(crashtracking): multi thread collection centos flakes harden (#2113)
[PROF-15089](https://datadoghq.atlassian.net/jira/software/c/projects/PROF/boards/11?selectedIssue=PROF-15089)
# What does this PR do?
On older kernels, there may be a race where `waitpid` reports a thread
as stopped but the register state hasn't been flushed to the
ptrace-accessible area yet. Reading registers in that window gives
zeros, causing libunwind to produce empty stack traces.
Adds a `wait_for_registers` polling loop after `attach_thread` that
spins on `PTRACE_PEEKUSER` until the instruction pointer is non-zero or
the existing deadline expires. On modern kernels this should return
immediately on the first iteration.
# Motivation
More
[flakes](https://app.datadoghq.com/ci/pipeline-executions?query=ci_level%3Apipeline%20%40git.repository.name%3ADataDog%2A%2Flibdatadog%20%28%40git.is_default_branch%3Atrue%20OR%20%40git.branch%3Amq%2A%29%20%40ci.status%3Aerror%20%21%40ci.pipeline.name%3ADDCI%2A%20%21%40ci.pipeline.name%3A%22Release%20-%20Open%20a%20release%20proposal%20PR%22&agg_m=count&agg_m_source=base&agg_t=count&fromUser=false&index=cipipeline&refresh_mode=sliding&tab=logs&start=1780928483247&end=1781533283247&paused=false)
on multi thread collection tests
# Additional Notes
Anything else we should know when reviewing?
# How to test the change?
I ran all thread collection tests on cent os 10x and observed no
failures
[PROF-15089]:
https://datadoghq.atlassian.net/browse/PROF-15089?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ1 parent c79d783 commit 1ce0b30
1 file changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
166 | 178 | | |
167 | 179 | | |
168 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
169 | 207 | | |
170 | 208 | | |
171 | 209 | | |
| |||
0 commit comments