Issue #7040 has been updated by nagachika (Tomoyuki Chikanaga).

File zlib_inflate_buf_error.patch added
Category changed from core to ext
Assignee changed from drbrain (Eric Hodel) to nagachika (Tomoyuki Chikanaga)

Hello,

I've investigated this little more deeper.

If inflate() (aka z->func->run()) return under condition which z->stream.avail_in == z->stream.avail_out == 0, current zstream_run_func() call inflate() once more even though there's no input available. In that case inflate() return Z_BUF_ERROR.

However, deflate() have hidden input buffer in z->stream.state (opaque structure) and should be called even when z->stream.avail_in == 0 (while z->stream.avail_out == 0).

I think zstream_run_func() should break from while loop when zstream->avail_in == 0 only if z->func->run == inflate.

I will commit an attached patch tomorrow if there's no objection.

ruby-dev ????ф?ユ?????с?????

??????絨????茯帥?鴻??帥?障????????

zstream_run_func() ??? inflate() (z->func->run()) ????????障????上?ュ?阪??????????????<????眼?c?????腥?/筝??????c?? (z->stream.avail_in == z->stream.avail_out == 0) ??ц????c?????????????篁?????茖????????????????<????≦宍???????綺? inflate() ?????若????с????障????障?????zlib ???ュ???????≪??????倶????? inflate() ?????若?吟?? Z_BUF_ERROR ???菴????????????с?????

?????? deflate() ???翫???????????? z->stream->state ???????篏???筝?????????????????????<???????c??????????????с??z->stream.avail_in == 0 ??с????????筝?綺? deflate() ?????若?九??荀????????????翫???????????????????с?????

羞私??????????????????????????? z->func->run ??? inflate ??????????? z->stream.avail_in == 0 ???????? zstream_run_func() ??? while ???若??????????????????篏??????? inflate() (z->func->run())?????若?違???????????????????????????????障????? make test-all ??????????医????с????????障????????
絎??????? gem ?????ゃ?潟?鴻????若??с???????????у?違?c?????????????????????с????鴻???絲障???????????井??ャ??с????潟??????????????????????????????障?????
----------------------------------------
Bug #7040: gem install ??х?劫????? gem ?????ゃ?潟?鴻????若??с??????
https://bugs.ruby-lang.org/issues/7040#change-30132

Author: hsbt (Hiroshi SHIBATA)
Status: Open
Priority: Normal
Assignee: nagachika (Tomoyuki Chikanaga)
Category: ext
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-09-20 trunk 36993) [x86_64-darwin12.2.0]


trunk ??х?劫????? gem(箴??????? libv8膈?)?????ゃ?潟?鴻????若???????????????????????紊掩???????????障????障?????

 % gem i libv8
 ERROR:  While executing gem ... (Zlib::BufError)
     buffer error

Twitter 筝???? nagachika ???????????? Zlib ??? GVL 絲上??????????????с??????????潟?<?潟?????????????障???????????筝?荐??????取;腓坂札?????茯??祉??????????????障????????



-- 
http://bugs.ruby-lang.org/