[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106933] [Ruby master Bug#10961] Zlib corrupts data when receive signal
From:
"usa (Usaku NAKAMURA)" <noreply@...>
Date:
2021-12-31 10:44:18 UTC
List:
ruby-core #106933
Issue #10961 has been updated by usa (Usaku NAKAMURA).
Backport changed from 2.6: REQUIRED, 2.7: REQUIRED, 3.0: REQUIRED to 2.6: REQUIRED, 2.7: DONE, 3.0: REQUIRED
ruby_2_7 50a986ca582bf16ed643cab33bad9d3d7ebb815d merged revision(s) 0c5f8c62766afe4605172800063e63fe36996658.
----------------------------------------
Bug #10961: Zlib corrupts data when receive signal
https://bugs.ruby-lang.org/issues/10961#change-95754
* Author: leiting (Lei Ting)
* Status: Closed
* Priority: Normal
* ruby -v: 2.0.0-p353 2.2.0
* Backport: 2.6: REQUIRED, 2.7: DONE, 3.0: REQUIRED
----------------------------------------
When receiving signal on main thread, Zlib::Deflate.deflate will be interrupted in zstream_run_func (zlib.c), thus producing unfinished output buffer.
Zlib::Deflate.deflate will return normally, without error, but the return value will be corrupted buffer and can't be decompressed.
Preferred fix: zstream_run() should check if err is Z_STREAM_END, if not, raise an error instead of return normally.
---
run zlib.rb to reproduce this problem:
# ruby zlib.rb
37028
generating len=1000000000 string...
string length=1000000000
compressing...
^CINT (press Ctrl+C or send a signal to the pid)
zlib.rb:13:in `deflate': data error (Zlib::DataError)
from zlib.rb:13:in `test_string'
from zlib.rb:25:in `block in <main>'
from zlib.rb:25:in `each'
from zlib.rb:25:in `<main>'
---Files--------------------------------
zlib.rb (646 Bytes)
bug10961.rb (312 Bytes)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>