Page 1 of 1

possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-05T18:04:02-07:00
by fmw42
IM 6.8.0.4 Q16 Mac OSX Snow Leopard

This works with direct PNG output:

convert zelda3.png 1tmpA1.mpc
convert 1tmpA1.mpc -color-matrix "6x3: \
1 1 1 0 0 0 \
1 1 1 0 0 0 \
1 1 1 0 0 0 \
" 1tmpzelda3_gray.png


This fails with temp MPC, then convert to PNG output:

convert zelda3.png 1tmpA1.mpc
convert 1tmpA1.mpc -color-matrix "6x3: \
1 1 1 0 0 0 \
1 1 1 0 0 0 \
1 1 1 0 0 0 \
" 1tmpA1.mpc
convert 1tmpA1.mpc 1tmpzelda3_gray.png


convert(1749) malloc: *** error for object 0x100c13308: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap


Am I misunderstanding something here?

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-05T21:24:00-07:00
by fmw42
P.S.

It works fine with MIFF:

convert zelda3.png 1tmpA1.miff
convert 1tmpA1.miff -color-matrix "6x3: \
1 1 1 0 0 0 \
1 1 1 0 0 0 \
1 1 1 0 0 0 \
" 1tmpA1.miff
convert 1tmpA1.miff 1tmpzelda3_gray.png


But even normalizing the values to 0.3333, (convert color to average gray), fails with MPC


ff=0.333333
convert zelda3.png 1tmpA1.mpc
convert 1tmpA1.mpc -color-matrix "6x3: \
$ff $ff $ff 0 0 0 \
$ff $ff $ff 0 0 0 \
$ff $ff $ff 0 0 0 \
" 1tmpA1.mpc
convert 1tmpA1.mpc 1tmpzelda3_gray.png

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-05T21:39:45-07:00
by fmw42
P.S. 2

A few of my scripts that I have tested are failing from this same error and they do not use -color-matrix.

It seems to be associated with saving a .MPC tempfile to itself after processing and then using

convert tmp.mpc outputfile

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-05T21:41:46-07:00
by fmw42
P.S. 3

It seems to work fine in IM 6.8.0.3 Q16 Mac OSX Snow Leopard. Seems to be introduced in IM 6.8.0.4.

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-07T08:06:09-07:00
by glennrp
I can't reproduce this problem on Ubuntu 12-04 with IM-6.8.0-4 and libpng-1.5.13. I guess it is some sort of race condition with the MPC being overwritten as Fred suggests. To those who do observe the bug, does it happen if you use another output format instead of png?

[edit] I'm seeing the bug now, SVN revision 9887. Answering my own question -- it's only showing up when PNG is the output format, after trying a few others.
[edit 2] I tried reverting coders/png.c to an earlier version (6.8.0-2) but that did not help.

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-07T09:29:47-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.0-5 Beta available within a few days. Thanks.

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-10T11:43:02-07:00
by fmw42
I can't reproduce this problem on Ubuntu 12-04 with IM-6.8.0-4 and libpng-1.5.13. I guess it is some sort of race condition with the MPC being overwritten as Fred suggests. To those who do observe the bug, does it happen if you use another output format instead of png?
Glenn,

It only fails when the output is png. The input format does not matter. If the input format is png, jpg, gif, but the output is png, it fails. It works fine if the input is png and the output is jpg, gif or tiff.

I am using libpng 1.4.11. I had to back down from libpng 1.5.x so that I could keep testing (already compiled) older versions of IM without having to recompile each one.

Fred

Re: possible MPC bug IM 6.8.0.4 Q16

Posted: 2012-11-10T15:27:54-07:00
by fmw42
The problem appears to be fixed in IM 6.8.0.5 Q16 beta ( HDRI ).