Skip to content

Commit 059bbf5

Browse files
[test][Backtracing] Fix crash message pattern for single threaded mode
With libdispatch executor, `level` function is called on non-main thread because it does not specify main executor explicitly. Therefore, the crash message from swift-backtrace says `Thread 1 crashed: ...`. However, with single threaded executor, all jobs are executed on the main thread, and main thread always has its name, so the message can be thread name 'Thread 0 "CrashAsync" crashed:'.
1 parent 330af0b commit 059bbf5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Backtracing/CrashAsync.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct CrashAsync {
4040

4141
// CHECK: *** Program crashed: Bad pointer dereference at 0x{{0+}}4 ***
4242

43-
// CHECK: Thread {{[0-9]+}} crashed:
43+
// CHECK: Thread {{[0-9]+( ".*")?}} crashed:
4444

4545
// CHECK: 0 0x{{[0-9a-f]+}} {{_?}}$s10CrashAsync5crashyyF + {{[0-9]+}} in CrashAsync at {{.*}}/CrashAsync.swift:21:15
4646
// CHECK-NEXT: 1 [ra] 0x{{[0-9a-f]+}} {{_?}}$s10CrashAsync5levelyySiYaFTY0_ + {{[0-9]+}} in CrashAsync at {{.*}}/CrashAsync.swift:29:5
@@ -57,7 +57,7 @@ struct CrashAsync {
5757

5858
// FRIENDLY: *** Program crashed: Bad pointer dereference at 0x{{0+}}4 ***
5959

60-
// FRIENDLY: Thread {{[0-9]+}} crashed:
60+
// FRIENDLY: Thread {{[0-9]+( ".*")?}} crashed:
6161

6262
// FRIENDLY: 0 {{_?}}$s10CrashAsync5crashyyF + {{[0-9]+}} in CrashAsync at {{.*}}CrashAsync.swift:21:15
6363

0 commit comments

Comments
 (0)