Commit 40deed0
[test] Avoid race in glibc's pthread_detach.
```
if (atomic_compare_and_exchange_bool_acq (&pd->joinid, pd, NULL))
{
if (IS_DETACHED (pd))
```
If the thread exits between these two statements, it will destroy the TCB and the second statement will segfault.
TEST=ffi/async_void_function_callbacks_test
Change-Id: If4074c89ec2a618b69f1a1ef3300b8aef7527ef7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424380
Reviewed-by: Daco Harkes <[email protected]>
Commit-Queue: Ryan Macnak <[email protected]>1 parent 087ba40 commit 40deed0
1 file changed
+38
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1329 | 1346 | | |
1330 | 1347 | | |
1331 | 1348 | | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1332 | 1369 | | |
1333 | 1370 | | |
| 1371 | + | |
1334 | 1372 | | |
1335 | 1373 | | |
1336 | 1374 | | |
| |||
0 commit comments