Commit 9e48ebf
Fix IOBuffer data race in stdio_loop / take! (#120)
Two background tasks (stdout + stderr) wrote to the same IOBuffer
concurrently, and the main test loop called take! without any
synchronisation. Julia's IOBuffer is not thread-safe, so this caused
torn reads of io.size vs io.data under higher I/O load, manifesting as:
DimensionMismatch: Attempted to wrap a MemoryRef of length N with
an Array of size dims=(M,)
Fix: add a ReentrantLock to PTRWorker; both stdio_loop write tasks
and the take! call in runtests hold the lock.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 5ad80db commit 9e48ebf
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
39 | 41 | | |
40 | | - | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
261 | | - | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
265 | | - | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
273 | | - | |
| 275 | + | |
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
| |||
1061 | 1063 | | |
1062 | 1064 | | |
1063 | 1065 | | |
1064 | | - | |
| 1066 | + | |
1065 | 1067 | | |
1066 | 1068 | | |
1067 | 1069 | | |
| |||
0 commit comments