possible MPC bug IM 6.8.0.4 Q16

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible MPC bug IM 6.8.0.4 Q16

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible MPC bug IM 6.8.0.4 Q16

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible MPC bug IM 6.8.0.4 Q16

Post 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
Last edited by fmw42 on 2012-11-05T22:01:52-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible MPC bug IM 6.8.0.4 Q16

Post 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.
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: possible MPC bug IM 6.8.0.4 Q16

Post 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.
Last edited by glennrp on 2012-11-07T10:29:09-07:00, edited 2 times in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible MPC bug IM 6.8.0.4 Q16

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible MPC bug IM 6.8.0.4 Q16

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible MPC bug IM 6.8.0.4 Q16

Post by fmw42 »

The problem appears to be fixed in IM 6.8.0.5 Q16 beta ( HDRI ).
Post Reply