reassign 729941 liblzma5
thanks

Hallo Adam,
* Adam Borowski [Fri, Nov 22 2013, 12:20:59AM]:
> On Tue, Nov 19, 2013 at 12:28:53PM +0100, Eduard Bloch wrote:
> > Could you also turn up debug= value to 7 and send me your logs after a
> > couple of days?
> 
> Attached.  This comes without a manual intervention since nuking the cache
> on Tuesday.  This time, the failures include experimental/main/binary-armhf
> in addition to experimental/non-free/binary-amd64 (I got amd64, i386 and
> armhf installs at home).

Thanks. After all, I was able to reproduce it on my system with the
current version of the mentioned Packages.xz file and... it turned out
to be a weird behaviour of
ii  liblzma5:amd64 5.1.1alpha+2 amd64        XZ-format compression library

Apparently, on the last cycle of lzma_code(&strm, LZMA_RUN) it does not
return LZMA_STREAM_END but LZMA_OK although the strm.avail_in value
is zero which means that there is no more data to be expected. I am not
sure why the problem occurs on exactly this file but I can reproduce it
(for reproduction: sample code below, to be used with an output buffer
of 20000 bytes size, the FLAG_* constants are internal flag bits, just
ignore).

The problematic file is also attached. I will a workaround for now to
apt-cacher-ng.

Regards,
Eduard.

#ifdef HAVE_LZMA
#include <lzma.h>

class tXzDec : public IDecompressor
{
        lzma_stream strm;
public:
        tXzDec(bool lzmaFormat=false)
        {
                ::memset(&strm, 0, sizeof(strm));
                if(lzmaFormat)
                        inited = (LZMA_OK == lzma_alone_decoder(&strm,
                                        EXTREME_MEMORY_SAVING ? 32000000 : 
MAX_VAL(uint64_t)));
                else
                        inited = (LZMA_OK == lzma_stream_decoder(&strm,
                                EXTREME_MEMORY_SAVING ? 32000000 : 
MAX_VAL(uint64_t),
                                                LZMA_TELL_UNSUPPORTED_CHECK | 
LZMA_CONCATENATED));
        }
        ~tXzDec()
        {
                lzma_end(&strm);
                inited = false;
        }
        virtual UINT UncompMore(char *szInBuf, size_t nBufSize, size_t 
&nBufPos, acbuf &UncompBuf)
        {
                strm.next_in = (uint8_t*) szInBuf + nBufPos;
                strm.avail_in = nBufSize - nBufPos;
                strm.next_out = (uint8_t*) UncompBuf.wptr();
                strm.avail_out = UncompBuf.freecapa();

                lzma_ret ret=lzma_code(&strm, LZMA_RUN);
                if (ret == LZMA_STREAM_END || ret == LZMA_OK)
                {
                        nBufPos = nBufSize - strm.avail_in;
                        if(!strm.avail_in)
                                ret == LZMA_STREAM_END; // looks like liblzma 
bug, working around
                        unsigned int nGotBytes = UncompBuf.freecapa() - 
strm.avail_out;
                        UncompBuf.got(nGotBytes);
                        return ret == LZMA_STREAM_END ? FLAG_COMPEOF : 0;
                }
                // or corrupted data?
                return (FLAG_COMPEOF | FLAG_ERROR);
        }
};
#end


Attachment: Packages.xz
Description: Binary data

Reply via email to