aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.95k stars 614 forks source link

Can we workaround while gm hang? #384

Closed chinajuanbob closed 9 years ago

chinajuanbob commented 9 years ago

I try convert command with a few images and gm hang with one of them. It is a gm bug. If issue the command with gm directly, It need ctrl+c twice to stop it, and in node, just hang there for ever. I wonder if there is a way that we can workaround gm hang problem, and callback an error to node after some while or detect gm hang?

Thanks a lot!

Some info for you to reproduce: system ubuntu 12.04 gm version 1.3.12 The url of image is http://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-40565.png The command is gm convert /home/wallhaven-40565.png -resize 250x250 -colors 32 - The output is PNG

* glibc detected * gm: malloc(): memory corruption: 0x00007ffaa6eca7b0 ***

rwky commented 9 years ago

We now have timeout support, you can pass the timeout option to kill the spawn process after x milliseconds.

Also I don't know if the gm bug is fixed in versions >1.3.12 but you could try my ppa which contains 1.3.21 https://launchpad.net/~rwky/+archive/ubuntu/graphicsmagick (shameless plug)