java 中由于 JDK 的 gzip 存在 BUG, 导致在某些场景下,会出现死循环,cpu 使用率暴增 100%

gzip jdk8's infinite loop.excalidraw

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠

Text Elements

write

finish

a bytes

deflate

write

b bytes

error

deflate

deflate

bug

b*n > a

error

buffer

dirty

set-finish

setInputs

needsInput

deflat

bLength 写入的 b 数据

blength>0

loop

minusLength dirty-loopUnit

io

minusLength > 0

finish != null bLength = minusLength

Link to original

见问题

8193682: Infinite loop in ZipOutputStream.close() by raviniitw2012 · Pull Request5522 · openjdk/jdk · GitHub