Page 1 of 1

Convert crashes with -verbose on multilayer PSD input.

Posted: 2008-12-11T08:21:49-07:00
by adambuchbinder
Originally reported to Ubuntu's bugtracker, then found to exist in SVN r13567.

https://bugs.edge.launchpad.net/ubuntu/ ... bug/302454

The command requires the following file:

http://launchpadlibrarian.net/19964799/small-test.psd

Running "convert small-test.psd small-test-tmp%d.tif" completes properly and produces correct output, but "convert -verbose small-test.psd small-test-tmp%d.tif" crashes. I'm running Ubuntu Intrepid on a dual-core Pentium 4. If there's anything else that might be useful, please let me know and I'll do my best to provide it.

Re: Convert crashes with -verbose on multilayer PSD input.

Posted: 2008-12-11T19:29:52-07:00
by magick
It appears that libTIFF is corrupting memory when TIFFSetField(tiff,TIFFTAG_PHOTOSHOP,...) is called with the profile that is embedded in your PSD file. However, we can't be sure since both valgrind and gdb do not offer any clues. A fix in the mean-time is to comment out the call to TIFFPrintDirectory() in coders/tiff.c/WriteTIFFImage(). We will put this patch in Subversion by sometime tomorrow as a workaround and continue to track where the memory corruption originates.

Re: Convert crashes with -verbose on multilayer PSD input.

Posted: 2008-12-12T07:25:03-07:00
by adambuchbinder
Thank you for looking into this so quickly.

I believe the image was created by an older version of Hugin; if multilayer PSD files I create with the current version cause the same problems, should I notify the developers of that project? Is there anything invalid about the PSD file supplied, and if so, is there any way I can test that apart from seeing if convert crashes?

I realize that convert shouldn't crash on invalid input, but if another program is producing invalid files, I should probably let them know about it.

Re: Convert crashes with -verbose on multilayer PSD input.

Posted: 2008-12-12T08:19:58-07:00
by magick
We do not know where the corruption occurs just yet. It could be in the PSD file, ImageMagick, or libTIFF. We will investigate further but given the demands on our time we cannot predict yet when our work will be complete.

Re: Convert crashes with -verbose on multilayer PSD input.

Posted: 2011-06-15T06:20:32-07:00
by broucaries
Any news of this bug ?

Re: Convert crashes with -verbose on multilayer PSD input.

Posted: 2011-06-15T06:46:31-07:00
by magick
We don't see a Changelog entry for a patch for this problem, however, we currently cannot reproduce the problem with ImageMagick 6.7.0-7 and LIBTIFF, version 3.9.5 . We ran the command 10,000 times and no memory corruption / fault were evident. Valgrind does not complain either.