Skip to content

Commit

Permalink
[TSan] Relax pthread introspection-based test
Browse files Browse the repository at this point in the history
Thread create/destroy events are not guaranteed to belivered on the
parent thread, e.g., output from a CI job:
```
5: THREAD_CREATE 0x7e8000104000, self: 0x1102ebdc0, name: n/a
6: THREAD_START 0x7e8000104000, self: 0x7e8000104000, name: n/a
7: Hello from pthread
8: THREAD_TERMINATE 0x7e8000104000, self: 0x7e8000104000, name: child thread
9: THREAD_DESTROY 0x7e8000104000, self: 0x7e8000104000, name: child thread
```
Here, THREAD_DESTROY is delivered on the thread being destroyed.

rdar://92679941
  • Loading branch information
Julian Lettner committed May 13, 2022
1 parent 8a0fb96 commit 824d830
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/test/tsan/Darwin/dyld-insert-libraries.c
Expand Up @@ -105,9 +105,9 @@ int main() {
// CHECK: main
// Ignore TSan background thread.
// CHECK: THREAD_CREATE
// CHECK: THREAD_CREATE [[CHILD:0x[0-9a-f]+]], self: [[MAIN:0x[0-9a-f]+]], name: n/a
// CHECK: THREAD_CREATE [[CHILD:0x[0-9a-f]+]]
// CHECK: THREAD_START [[CHILD]], self: [[CHILD]], name: n/a
// CHECK: Hello from pthread
// CHECK: THREAD_TERMINATE [[CHILD]], self: [[CHILD]], name: child thread
// CHECK: THREAD_DESTROY [[CHILD]], self: [[MAIN]]
// CHECK: THREAD_DESTROY [[CHILD]]
// CHECK: Done.

0 comments on commit 824d830

Please sign in to comment.