Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

zlib unpacking yields in assertion error #1882

Closed
andris9 opened this Issue Oct 13, 2011 · 3 comments

Comments

Projects
None yet
2 participants

andris9 commented Oct 13, 2011

Node.js: v0.5.9, v0.5.8
Systems: OSX, Debian Lenny

When trying to unpack (gunzip or inflte) data with zlib, assertion error occurs.

Using he following script (slightly modified from the zlib section in node.js manual, createGzip changed to createGunzip) and the output length (unpacked.txt) should be 32kB or larger:

var zlib = require('zlib');
var gzip = zlib.createGunzip();
var fs = require('fs');
var inp = fs.createReadStream('packed.gz');
var out = fs.createWriteStream('unpacked.txt');

inp.pipe(gzip).pipe(out);

The following error occurs:

node: ../src/node_zlib.cc:104: static v8::Handle<v8::Value> 
    node::ZCtx<mode>::Write(const v8::Arguments&) [with 
    node::node_zlib_mode mode = INFLATERAW]: 
    Assertion `in_off + in_len <= Buffer::Length(in_buf)' failed.
Aborted

isaacs commented Oct 13, 2011

I can reproduce. Investigating.

@ghost ghost assigned isaacs Oct 13, 2011

@isaacs isaacs closed this in 59a5262 Oct 13, 2011

andris9 commented Oct 14, 2011

wow, that was fast, thanks!

isaacs commented Oct 14, 2011

Failing assert + reproducible test = easy fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment