Commit daa0f55
authored
Fix browser.test_fetch_stream_abort_asan race condition (#25931)
Fix `browser.test_fetch_stream_abort_asan race` condition by avoiding
double free of the fetch structure.
The issue in the test was that `onprogress` handler in the test would
queue a setimmediate to free the fetch structure after the turn of the
event loop.
But the browser might also have fed a second `onprogress` handler call
before the previous setimmediate, which would also trigger a second
setimmediate callback.
Then the two setimmediate callbacks would fire, resulting in a double
`emscripten_fetch_close()` calls, and the asan test croaking:
<img width="1361" height="1352" alt="image"
src="https://github.com/user-attachments/assets/067491b5-0093-4072-98a6-aa02911e3693"
/>
Fix the race condition by ensuring only a single abort is queued.1 parent e7706b3 commit daa0f55
1 file changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
0 commit comments