Convert crashes with -verbose on multilayer PSD input.

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
adambuchbinder

Convert crashes with -verbose on multilayer PSD input.

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
adambuchbinder

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

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

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

Post by broucaries »

Any news of this bug ?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
Post Reply