node-unzip icon indicating copy to clipboard operation
node-unzip copied to clipboard

Maximum call stack size exceeded

Open ccksfh opened this issue 10 years ago • 1 comments

(node) warning: Recursive process.nextTick detected. This will break in the next version of node.Please use setImmediate for recursive deferral.

The message kept pumping up while doing the extracting then finally throw 'Maximum call stack size exceeded' and program died.

My unzip is version 0.1.9 and with node v0.10.23.And the size of my zip file is only 3.53MB

ccksfh avatar Aug 22 '14 10:08 ccksfh

This repo has switched to setImmediate instead of next tick for some time. But the call stack exceeding could be happening because of a bug in the code for dealing with zip files that have compressed files stored in the streaming mode of the zip format.

If this was your situation then this bug has been fixed by https://www.npmjs.com/package/unzip2, as this repo seems abandoned.

It comes down to the lines in lib/parse.js:161

setImmediate(function() {
  self._pullStream.unpipe();
  self._pullStream.prepend(extra);
  self._processDataDescriptor(entry);
});

should be

self._pullStream.unpipe();
self._pullStream.prepend(extra);
setImmediate(function() {
  self._processDataDescriptor(entry);
});

dvalentiate avatar Mar 30 '15 11:03 dvalentiate