Commit 60b75c4
committed
[hotfix] Fix logical data-race in list-windows/expandFormatVar
#1306
Precondtion: Use `list-windows` command in `exec-on-workspace-change`
callback
The race is between `list-windows` and `MacWindow.garbageCollect`
This hotfix drops all possible `await` supension points from the
`list-windows` command & `expandFormatVar` function
Crash example:
##### AeroSpace Runtime Error #####
Please report to:
https://github.com/nikitabobko/AeroSpace/discussions/categories/potential-bugs
Please describe what you did to trigger this error
Message:
Windows must always have a parent. The Window was unbound at:
0 AeroSpace 0x000000010236d110 $s6Common19getStringStacktraceSSyF + 44
1 AeroSpace 0x0000000102200fb4 $s9AppBundle8TreeNodeC13unbindIfBound33_C0BD111AB6D9D19A3A8697678A2C07EFLLAA11BindingDataVSgyF + 684
2 AeroSpace 0x0000000102201260 $s9AppBundle8TreeNodeC16unbindFromParentAA11BindingDataVyF + 28
3 AeroSpace 0x00000001021fa778 $s9AppBundle9MacWindowC14garbageCollect22skipClosedWindowsCacheySb_tF + 240
4 AeroSpace 0x00000001021d4604 $s9AppBundle7refresh33_9D4CAE07A16011BB7304F8F5007BD739LLyyYaKFTY2_ + 292
5 AeroSpace 0x00000001021cff7d $s9AppBundle25runRefreshSessionBlocking_16layoutWorkspaces023optimisticallyPreLayoutH0y6Common0dE5EventO_S2btYaKFyyYaKXEfU_yyYaKXEfU_TQ6_ + 1
6 AeroSpace 0x000000010215c9b1 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TATQ0_ + 1
7 libswift_Concurrency.dylib 0x000000027085c461 $ss9TaskLocalC13withValueImpl_9operation9isolation4file4lineqd__xn_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
8 libswift_Concurrency.dylib 0x000000027085c109 $ss9TaskLocalC9withValue_9operation9isolation4file4lineqd__x_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
9 AeroSpace 0x00000001021cf251 $s9AppBundle25runRefreshSessionBlocking_16layoutWorkspaces023optimisticallyPreLayoutH0y6Common0dE5EventO_S2btYaKFyyYaKXEfU_TQ1_ + 1
10 AeroSpace 0x000000010215c9b1 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TATQ0_ + 1
11 libswift_Concurrency.dylib 0x000000027085c461 $ss9TaskLocalC13withValueImpl_9operation9isolation4file4lineqd__xn_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
12 libswift_Concurrency.dylib 0x000000027085c109 $ss9TaskLocalC9withValue_9operation9isolation4file4lineqd__x_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
13 AeroSpace 0x00000001021ce7b9 $s9AppBundle25runRefreshSessionBlocking_16layoutWorkspaces023optimisticallyPreLayoutH0y6Common0dE5EventO_S2btYaKFTQ1_ + 1
14 AeroSpace 0x00000001021cef71 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TQ1_ + 1
15 AeroSpace 0x000000010215c9b1 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TATQ0_ + 1
16 libswift_Concurrency.dylib 0x000000027089083d _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 1
Version: 0.18.3-Beta
Git hash: 3af07d9
refreshSessionEvent: socketServer
Date: 2025-04-26 19:13:28 +0000
Thread name:
Is main thread: true
axTaskLocalAppThreadToken: nil
macOS version: Version 15.4 (Build 24E248)
Coordinate: AppBundle/Window.swift:8:29 parent
recursionDetectorDuringTermination: false
cli: false
Monitor count: 2
Displays have separate spaces: false
Stacktrace:
0 AeroSpace 0x000000010236c73c $s6Common4dieT_4file4line6column8functionxSS_SSS2iSStlF + 2256
1 AeroSpace 0x0000000102203888 $s9AppBundle6WindowC6parentAA21NonLeafTreeNodeObject_pvg + 260
2 AeroSpace 0x00000001022028d4 $s9AppBundle8TreeNodeC11nodeMonitorAA0F0_pSgvg + 68
3 AeroSpace 0x000000010216a4b0 $sSS9AppBundleE15expandFormatVar3objs6ResultOyAA9PrimitiveOS2Ss5Error6CommonyHCg_GAA7AeroObjO_tYaKFTY0_ + 1356
4 AeroSpace 0x00000001021691c1 $sSa9AppBundleAA7AeroObjORszlE6formatys6ResultOySaySSGS2Ss5Error6CommonyHCg_GSayAI16StringInterTokenOGYaKFTQ1_ + 1
5 AeroSpace 0x000000010218f0d5 $s9AppBundle18ListWindowsCommandV3runySbAA6CmdEnvV_AA0G2IoCtYaKFTf4dnn_nTQ5_ + 1
6 AeroSpace 0x000000010218afe1 $s9AppBundle18ListWindowsCommandVAA0E0A2aDP3runySbAA6CmdEnvV_AA0G2IoCtYaKFTWTQ0_ + 1
7 AeroSpace 0x0000000102164431 $sSa9AppBundleAA7Command_pRszlE9runCmdSeqySbAA0E3EnvV_AA0E2IoCntYaKFTQ1_ + 1
8 AeroSpace 0x0000000102163d79 $s9AppBundle7CommandPAAE3runyAA9CmdResultVAA0E3EnvV_AA0E5StdinCtYaKFTQ2_ + 1
9 AeroSpace 0x00000001021e49dd $s9AppBundle13newConnection33_8AA123C1AC8B76A52844CE5C668569DDLLyy6SocketADCYaF6Common12ServerAnswerVyYaKcfU0_AHyYaYbKScMYcXEfU_TQ1_ + 1
10 AeroSpace 0x000000010215c3f5 $s9AppBundle14GlobalObserverC7onNotif33_F1205CFDC13498282252A689C79131F6LLyy10Foundation12NotificationVFZyyYaYbScMYccfU_TATQ0_ + 1
11 AeroSpace 0x00000001021c8899 $s9AppBundle10runSession__4bodyx6Common07RefreshD5EventO_AA03RunD5GuardVxyYaYbKScMYcXEtYaKlFxyYaKXEfU_xyYaKXEfU_AD12ServerAnswerV_Tg5TQ7_ + 1
12 AeroSpace 0x000000010215c9b1 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TATQ0_ + 1
13 libswift_Concurrency.dylib 0x000000027085c461 $ss9TaskLocalC13withValueImpl_9operation9isolation4file4lineqd__xn_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
14 libswift_Concurrency.dylib 0x000000027085c109 $ss9TaskLocalC9withValue_9operation9isolation4file4lineqd__x_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
15 AeroSpace 0x00000001021c5f1d $s9AppBundle10runSession__4bodyx6Common07RefreshD5EventO_AA03RunD5GuardVxyYaYbKScMYcXEtYaKlFxyYaKXEfU_AD12ServerAnswerV_Tg5TQ1_ + 1
16 AeroSpace 0x000000010215c9b1 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TATQ0_ + 1
17 libswift_Concurrency.dylib 0x000000027085c461 $ss9TaskLocalC13withValueImpl_9operation9isolation4file4lineqd__xn_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
18 libswift_Concurrency.dylib 0x000000027085c109 $ss9TaskLocalC9withValue_9operation9isolation4file4lineqd__x_qd__yYaKXEScA_pSgYiSSSutYaKlFTQ1_ + 1
19 AeroSpace 0x00000001021c327d $s9AppBundle10runSession__4bodyx6Common07RefreshD5EventO_AA03RunD5GuardVxyYaYbKScMYcXEtYaKlFAD12ServerAnswerV_Tg5TQ1_ + 1
20 AeroSpace 0x00000001021c13d5 $s9AppBundle13newConnection33_8AA123C1AC8B76A52844CE5C668569DDLLyy6SocketADCYaF6Common12ServerAnswerVyYaKcfU0_TQ1_ + 1
21 AeroSpace 0x000000010215c9b1 $s9AppBundle17runRefreshSession_26screenIsDefinitelyUnlocked33optimisticallyPreLayoutWorkspacesy6Common0dE5EventO_S2btFyyYaKcfU_TATQ0_ + 1
22 libswift_Concurrency.dylib 0x000000027089083d _ZL23completeTaskWithClosurePN5swift12AsyncContextEPNS_10SwiftErrorE + 11 parent 3af07d9 commit 60b75c4
File tree
7 files changed
+34
-32
lines changed- Sources/AppBundle
- command
- impl
- tree
7 files changed
+34
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
0 commit comments