Commit 25984e2
Fix
When a `ReadBuffer::nextImpl` throws, `ReadBuffer::next` calls `cancel()`
and re-throws. The minizip library catches the exception via the C callback
(`readFileFunc`) which stores it and returns 0. However, minizip may then
call `readFileFunc` again before the stored exception is re-thrown via
`rethrowStreamException`. At that point the underlying `ReadBuffer` is
already canceled, and the `chassert(!isCanceled())` in `ReadBuffer::next`
fires as a logical error.
The fix adds early-return checks for `stored_exception` in all minizip
callback functions (`readFileFunc`, `tellFunc`, `seekFunc`, `writeFileFunc`)
to avoid touching the buffer after a prior exception has already canceled it.
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100395&sha=97c66cfd486cfc33344b02f7bf69a66ce1664104&name_0=PR&name_1=Stress%20test%20%28amd_msan%29
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>ReadBuffer is canceled exception in zip archive operations1 parent 9e0dd1f commit 25984e2
2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
133 | 135 | | |
134 | 136 | | |
135 | 137 | | |
| |||
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
| 151 | + | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| 169 | + | |
| 170 | + | |
165 | 171 | | |
166 | 172 | | |
167 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
241 | 243 | | |
242 | 244 | | |
243 | 245 | | |
| 246 | + | |
| 247 | + | |
244 | 248 | | |
245 | 249 | | |
246 | 250 | | |
| |||
0 commit comments