Repository navigation
Commit 5e9de79
Raise InProgressError from GzipFile methods while the stream is running
GzipFile methods did not check ZSTREAM_IN_PROGRESS either, so another
thread could close the stream or replace its buffer while zlib was
running without the GVL.
gz = Zlib::GzipWriter.new(StringIO.new)
q = Thread::Queue.new
Thread.new { q.pop; gz.close }
gz.write("x")
q << true
gz.write(Random.bytes(10_000_000))
#=> can't modify frozen NilClass: nil (FrozenError)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent d5e96c9 commit 5e9de79
2 files changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3358 | 3358 | | |
3359 | 3359 | | |
3360 | 3360 | | |
| 3361 | + | |
3361 | 3362 | | |
3362 | 3363 | | |
3363 | 3364 | | |
| |||
3705 | 3706 | | |
3706 | 3707 | | |
3707 | 3708 | | |
| 3709 | + | |
3708 | 3710 | | |
3709 | 3711 | | |
3710 | 3712 | | |
| |||
4251 | 4253 | | |
4252 | 4254 | | |
4253 | 4255 | | |
| 4256 | + | |
4254 | 4257 | | |
4255 | 4258 | | |
4256 | 4259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1966 | 1966 | | |
1967 | 1967 | | |
1968 | 1968 | | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
1969 | 1990 | | |
1970 | 1991 | | |
1971 | 1992 | | |
| |||
0 commit comments