galkahana / HummusJS

Node.js module for high performance creation, modification and parsing of PDF files and streams
http://www.pdfhummus.com
Other
1.14k stars 169 forks source link

Error in `node': corrupted double-linked list #243

Open mezgaAladar opened 6 years ago

mezgaAladar commented 6 years ago

I tried to use the hummusRecipe module which built on the top of HummusJS.

I tried to split an array of pdfs in a promise sync loop. This is my code:

Promise.mapSeries(pdfArr, function(pdf) {
  return new Promise( (resolve) => {
    var pdfDoc = new HummusRecipe(pdfpath + pdf);
    pdfDoc
      .split(pdfpath, pdf + "_split")
      .endPDF(function () {
        resolve();
      });
    });
  });

It is working when I have ~10-20 files. When I have ~70 files then it split the first 20-30 files (tried multiple times, got different results) and throw this error: Error in 'node': corrupted double-linked list: 0x000000000505e330 ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f4d2c2147e5] /lib/x86_64-linux-gnu/libc.so.6(+0x82970)[0x7f4d2c21f970] /lib/x86_64-linux-gnu/libc.so.6(__libc_malloc+0x54)[0x7f4d2c221184] /usr/lib/x86_64-linux-gnu/libstdc++.so.6(_Znwm+0x18)[0x7f4d2cd30e78]

/node_modules/hummus/binding/hummus.node(_ZN24OutputStringBufferStreamC1Ev+0x22)[0x7f4d29d64d62] ... Thanks if you have any idea why this memory error happens, or if you have any project for split PDFs