IM 6.9.2 crash with some PNG

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
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

IM 6.9.2 crash with some PNG

Post by kriks »

Hi

we recently encountered a problem that IM crashes with a command like this

Code: Select all

convert -verbose -background transparent trim.png  +repage -resample 300x300 -density 300 -resize x740 -gravity NorthEast -splice -228.10734463277x50 -gravity SouthWest -splice 50x50 +repage -compress LZW -quality 90 PNG32:out.png
trim.png PNG 3148x4055 3148x4055+0+0 8-bit sRGB 9.158MB 0.000u 0:00.000
Abandon
I cannot give the source file publicly, but I can send it to IM people if needed.
The source PNG is also the result of another convert command.

I've tested it on gentoo and mageia.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: IM 6.9.2 crash with some PNG

Post by fmw42 »

-quality 90
FYI, 90 means something different for PNG than it does for JPG. See http://www.imagemagick.org/script/comma ... hp#quality

Also you may be running out of tmp space. Check your tmp directory to see if it needs cleaning out from old files left behind that were not cleaned up automatically.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: IM 6.9.2 crash with some PNG

Post by snibgo »

It just says "Abandon" when it fails? I've never seen that.

What is the density of the input file? "-resample" can try to make very large sizes if the input desity is weird.
snibgo's IM pages: im.snibgo.com
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: IM 6.9.2 crash with some PNG

Post by glennrp »

If you have pngcheck, you can post the output of "pngcheck -v file.png", which should give us enough information to diagnose the problem.
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

Re: IM 6.9.2 crash with some PNG

Post by kriks »

Thank you all for having a look.

For the /tmp, I have 20GB available, it should be enough :)

Here is the pngcheck output :

Code: Select all

# pngcheck -v trim.png 
File: trim.png (9158238 bytes)
  chunk IHDR at offset 0x0000c, length 13
    3148 x 4055 image, 32-bit RGB+alpha, interlaced
  chunk cHRM at offset 0x00025, length 32
    White x = 0.3127 y = 0.329,  Red x = 0.64 y = 0.33
    Green x = 0.3 y = 0.6,  Blue x = 0.15 y = 0.06
  chunk bKGD at offset 0x00051, length 6
    red = 0x00ff, green = 0x00ff, blue = 0x00ff
  chunk pHYs at offset 0x00063, length 9: 47834x47834 pixels/meter (1215 dpi)
  chunk IDAT at offset 0x00078, length 32768
    zlib: deflated, 32K window, maximum compression
    rows per pass: 507, 507, 507, 1014, 1014, 2028, 2027
  chunk IDAT at offset 0x08084, length 32768
  chunk IDAT at offset 0x10090, length 32768
  chunk IDAT at offset 0x1809c, length 32768
  chunk IDAT at offset 0x200a8, length 32768
  chunk IDAT at offset 0x280b4, length 32768
  chunk IDAT at offset 0x300c0, length 32768
  chunk IDAT at offset 0x380cc, length 32768
  chunk IDAT at offset 0x400d8, length 32768
  chunk IDAT at offset 0x480e4, length 32768
  chunk IDAT at offset 0x500f0, length 32768
  chunk IDAT at offset 0x580fc, length 32768
  chunk IDAT at offset 0x60108, length 32768
  chunk IDAT at offset 0x68114, length 32768
  chunk IDAT at offset 0x70120, length 32768
  chunk IDAT at offset 0x7812c, length 32768
  chunk IDAT at offset 0x80138, length 32768
  chunk IDAT at offset 0x88144, length 32768
  chunk IDAT at offset 0x90150, length 32768
  chunk IDAT at offset 0x9815c, length 32768
  chunk IDAT at offset 0xa0168, length 32768
  chunk IDAT at offset 0xa8174, length 32768
  chunk IDAT at offset 0xb0180, length 32768
  chunk IDAT at offset 0xb818c, length 32768
  chunk IDAT at offset 0xc0198, length 32768
  chunk IDAT at offset 0xc81a4, length 32768
  chunk IDAT at offset 0xd01b0, length 32768
  chunk IDAT at offset 0xd81bc, length 32768
  chunk IDAT at offset 0xe01c8, length 32768
  chunk IDAT at offset 0xe81d4, length 32768
  chunk IDAT at offset 0xf01e0, length 32768
  chunk IDAT at offset 0xf81ec, length 32768
  chunk IDAT at offset 0x1001f8, length 32768
  chunk IDAT at offset 0x108204, length 32768
  chunk IDAT at offset 0x110210, length 32768
  chunk IDAT at offset 0x11821c, length 32768
  chunk IDAT at offset 0x120228, length 32768
  chunk IDAT at offset 0x128234, length 32768
  chunk IDAT at offset 0x130240, length 32768
  chunk IDAT at offset 0x13824c, length 32768
  chunk IDAT at offset 0x140258, length 32768
  chunk IDAT at offset 0x148264, length 32768
  chunk IDAT at offset 0x150270, length 32768
  chunk IDAT at offset 0x15827c, length 32768
  chunk IDAT at offset 0x160288, length 32768
  chunk IDAT at offset 0x168294, length 32768
  chunk IDAT at offset 0x1702a0, length 32768
  chunk IDAT at offset 0x1782ac, length 32768
  chunk IDAT at offset 0x1802b8, length 32768
  chunk IDAT at offset 0x1882c4, length 32768
  chunk IDAT at offset 0x1902d0, length 32768
  chunk IDAT at offset 0x1982dc, length 32768
  chunk IDAT at offset 0x1a02e8, length 32768
  chunk IDAT at offset 0x1a82f4, length 32768
  chunk IDAT at offset 0x1b0300, length 32768
  chunk IDAT at offset 0x1b830c, length 32768
  chunk IDAT at offset 0x1c0318, length 32768
  chunk IDAT at offset 0x1c8324, length 32768
  chunk IDAT at offset 0x1d0330, length 32768
  chunk IDAT at offset 0x1d833c, length 32768
  chunk IDAT at offset 0x1e0348, length 32768
  chunk IDAT at offset 0x1e8354, length 32768
  chunk IDAT at offset 0x1f0360, length 32768
  chunk IDAT at offset 0x1f836c, length 32768
  chunk IDAT at offset 0x200378, length 32768
  chunk IDAT at offset 0x208384, length 32768
  chunk IDAT at offset 0x210390, length 32768
  chunk IDAT at offset 0x21839c, length 32768
  chunk IDAT at offset 0x2203a8, length 32768
  chunk IDAT at offset 0x2283b4, length 32768
  chunk IDAT at offset 0x2303c0, length 32768
  chunk IDAT at offset 0x2383cc, length 32768
  chunk IDAT at offset 0x2403d8, length 32768
  chunk IDAT at offset 0x2483e4, length 32768
  chunk IDAT at offset 0x2503f0, length 32768
  chunk IDAT at offset 0x2583fc, length 32768
  chunk IDAT at offset 0x260408, length 32768
  chunk IDAT at offset 0x268414, length 32768
  chunk IDAT at offset 0x270420, length 32768
  chunk IDAT at offset 0x27842c, length 32768
  chunk IDAT at offset 0x280438, length 32768
  chunk IDAT at offset 0x288444, length 32768
  chunk IDAT at offset 0x290450, length 32768
  chunk IDAT at offset 0x29845c, length 32768
  chunk IDAT at offset 0x2a0468, length 32768
  chunk IDAT at offset 0x2a8474, length 32768
  chunk IDAT at offset 0x2b0480, length 32768
  chunk IDAT at offset 0x2b848c, length 32768
  chunk IDAT at offset 0x2c0498, length 32768
  chunk IDAT at offset 0x2c84a4, length 32768
  chunk IDAT at offset 0x2d04b0, length 32768
  chunk IDAT at offset 0x2d84bc, length 32768
  chunk IDAT at offset 0x2e04c8, length 32768
  chunk IDAT at offset 0x2e84d4, length 32768
  chunk IDAT at offset 0x2f04e0, length 32768
  chunk IDAT at offset 0x2f84ec, length 32768
  chunk IDAT at offset 0x3004f8, length 32768
  chunk IDAT at offset 0x308504, length 32768
  chunk IDAT at offset 0x310510, length 32768
  chunk IDAT at offset 0x31851c, length 32768
  chunk IDAT at offset 0x320528, length 32768
  chunk IDAT at offset 0x328534, length 32768
  chunk IDAT at offset 0x330540, length 32768
  chunk IDAT at offset 0x33854c, length 32768
  chunk IDAT at offset 0x340558, length 32768
  chunk IDAT at offset 0x348564, length 32768
  chunk IDAT at offset 0x350570, length 32768
  chunk IDAT at offset 0x35857c, length 32768
  chunk IDAT at offset 0x360588, length 32768
  chunk IDAT at offset 0x368594, length 32768
  chunk IDAT at offset 0x3705a0, length 32768
  chunk IDAT at offset 0x3785ac, length 32768
  chunk IDAT at offset 0x3805b8, length 32768
  chunk IDAT at offset 0x3885c4, length 32768
  chunk IDAT at offset 0x3905d0, length 32768
  chunk IDAT at offset 0x3985dc, length 32768
  chunk IDAT at offset 0x3a05e8, length 32768
  chunk IDAT at offset 0x3a85f4, length 32768
  chunk IDAT at offset 0x3b0600, length 32768
  chunk IDAT at offset 0x3b860c, length 32768
  chunk IDAT at offset 0x3c0618, length 32768
  chunk IDAT at offset 0x3c8624, length 32768
  chunk IDAT at offset 0x3d0630, length 32768
  chunk IDAT at offset 0x3d863c, length 32768
  chunk IDAT at offset 0x3e0648, length 32768
  chunk IDAT at offset 0x3e8654, length 32768
  chunk IDAT at offset 0x3f0660, length 32768
  chunk IDAT at offset 0x3f866c, length 32768
  chunk IDAT at offset 0x400678, length 32768
  chunk IDAT at offset 0x408684, length 32768
  chunk IDAT at offset 0x410690, length 32768
  chunk IDAT at offset 0x41869c, length 32768
  chunk IDAT at offset 0x4206a8, length 32768
  chunk IDAT at offset 0x4286b4, length 32768
  chunk IDAT at offset 0x4306c0, length 32768
  chunk IDAT at offset 0x4386cc, length 32768
  chunk IDAT at offset 0x4406d8, length 32768
  chunk IDAT at offset 0x4486e4, length 32768
  chunk IDAT at offset 0x4506f0, length 32768
  chunk IDAT at offset 0x4586fc, length 32768
  chunk IDAT at offset 0x460708, length 32768
  chunk IDAT at offset 0x468714, length 32768
  chunk IDAT at offset 0x470720, length 32768
  chunk IDAT at offset 0x47872c, length 32768
  chunk IDAT at offset 0x480738, length 32768
  chunk IDAT at offset 0x488744, length 32768
  chunk IDAT at offset 0x490750, length 32768
  chunk IDAT at offset 0x49875c, length 32768
  chunk IDAT at offset 0x4a0768, length 32768
  chunk IDAT at offset 0x4a8774, length 32768
  chunk IDAT at offset 0x4b0780, length 32768
  chunk IDAT at offset 0x4b878c, length 32768
  chunk IDAT at offset 0x4c0798, length 32768
  chunk IDAT at offset 0x4c87a4, length 32768
  chunk IDAT at offset 0x4d07b0, length 32768
  chunk IDAT at offset 0x4d87bc, length 32768
  chunk IDAT at offset 0x4e07c8, length 32768
  chunk IDAT at offset 0x4e87d4, length 32768
  chunk IDAT at offset 0x4f07e0, length 32768
  chunk IDAT at offset 0x4f87ec, length 32768
  chunk IDAT at offset 0x5007f8, length 32768
  chunk IDAT at offset 0x508804, length 32768
  chunk IDAT at offset 0x510810, length 32768
  chunk IDAT at offset 0x51881c, length 32768
  chunk IDAT at offset 0x520828, length 32768
  chunk IDAT at offset 0x528834, length 32768
  chunk IDAT at offset 0x530840, length 32768
  chunk IDAT at offset 0x53884c, length 32768
  chunk IDAT at offset 0x540858, length 32768
  chunk IDAT at offset 0x548864, length 32768
  chunk IDAT at offset 0x550870, length 32768
  chunk IDAT at offset 0x55887c, length 32768
  chunk IDAT at offset 0x560888, length 32768
  chunk IDAT at offset 0x568894, length 32768
  chunk IDAT at offset 0x5708a0, length 32768
  chunk IDAT at offset 0x5788ac, length 32768
  chunk IDAT at offset 0x5808b8, length 32768
  chunk IDAT at offset 0x5888c4, length 32768
  chunk IDAT at offset 0x5908d0, length 32768
  chunk IDAT at offset 0x5988dc, length 32768
  chunk IDAT at offset 0x5a08e8, length 32768
  chunk IDAT at offset 0x5a88f4, length 32768
  chunk IDAT at offset 0x5b0900, length 32768
  chunk IDAT at offset 0x5b890c, length 32768
  chunk IDAT at offset 0x5c0918, length 32768
  chunk IDAT at offset 0x5c8924, length 32768
  chunk IDAT at offset 0x5d0930, length 32768
  chunk IDAT at offset 0x5d893c, length 32768
  chunk IDAT at offset 0x5e0948, length 32768
  chunk IDAT at offset 0x5e8954, length 32768
  chunk IDAT at offset 0x5f0960, length 32768
  chunk IDAT at offset 0x5f896c, length 32768
  chunk IDAT at offset 0x600978, length 32768
  chunk IDAT at offset 0x608984, length 32768
  chunk IDAT at offset 0x610990, length 32768
  chunk IDAT at offset 0x61899c, length 32768
  chunk IDAT at offset 0x6209a8, length 32768
  chunk IDAT at offset 0x6289b4, length 32768
  chunk IDAT at offset 0x6309c0, length 32768
  chunk IDAT at offset 0x6389cc, length 32768
  chunk IDAT at offset 0x6409d8, length 32768
  chunk IDAT at offset 0x6489e4, length 32768
  chunk IDAT at offset 0x6509f0, length 32768
  chunk IDAT at offset 0x6589fc, length 32768
  chunk IDAT at offset 0x660a08, length 32768
  chunk IDAT at offset 0x668a14, length 32768
  chunk IDAT at offset 0x670a20, length 32768
  chunk IDAT at offset 0x678a2c, length 32768
  chunk IDAT at offset 0x680a38, length 32768
  chunk IDAT at offset 0x688a44, length 32768
  chunk IDAT at offset 0x690a50, length 32768
  chunk IDAT at offset 0x698a5c, length 32768
  chunk IDAT at offset 0x6a0a68, length 32768
  chunk IDAT at offset 0x6a8a74, length 32768
  chunk IDAT at offset 0x6b0a80, length 32768
  chunk IDAT at offset 0x6b8a8c, length 32768
  chunk IDAT at offset 0x6c0a98, length 32768
  chunk IDAT at offset 0x6c8aa4, length 32768
  chunk IDAT at offset 0x6d0ab0, length 32768
  chunk IDAT at offset 0x6d8abc, length 32768
  chunk IDAT at offset 0x6e0ac8, length 32768
  chunk IDAT at offset 0x6e8ad4, length 32768
  chunk IDAT at offset 0x6f0ae0, length 32768
  chunk IDAT at offset 0x6f8aec, length 32768
  chunk IDAT at offset 0x700af8, length 32768
  chunk IDAT at offset 0x708b04, length 32768
  chunk IDAT at offset 0x710b10, length 32768
  chunk IDAT at offset 0x718b1c, length 32768
  chunk IDAT at offset 0x720b28, length 32768
  chunk IDAT at offset 0x728b34, length 32768
  chunk IDAT at offset 0x730b40, length 32768
  chunk IDAT at offset 0x738b4c, length 32768
  chunk IDAT at offset 0x740b58, length 32768
  chunk IDAT at offset 0x748b64, length 32768
  chunk IDAT at offset 0x750b70, length 32768
  chunk IDAT at offset 0x758b7c, length 32768
  chunk IDAT at offset 0x760b88, length 32768
  chunk IDAT at offset 0x768b94, length 32768
  chunk IDAT at offset 0x770ba0, length 32768
  chunk IDAT at offset 0x778bac, length 32768
  chunk IDAT at offset 0x780bb8, length 32768
  chunk IDAT at offset 0x788bc4, length 32768
  chunk IDAT at offset 0x790bd0, length 32768
  chunk IDAT at offset 0x798bdc, length 32768
  chunk IDAT at offset 0x7a0be8, length 32768
  chunk IDAT at offset 0x7a8bf4, length 32768
  chunk IDAT at offset 0x7b0c00, length 32768
  chunk IDAT at offset 0x7b8c0c, length 32768
  chunk IDAT at offset 0x7c0c18, length 32768
  chunk IDAT at offset 0x7c8c24, length 32768
  chunk IDAT at offset 0x7d0c30, length 32768
  chunk IDAT at offset 0x7d8c3c, length 32768
  chunk IDAT at offset 0x7e0c48, length 32768
  chunk IDAT at offset 0x7e8c54, length 32768
  chunk IDAT at offset 0x7f0c60, length 32768
  chunk IDAT at offset 0x7f8c6c, length 32768
  chunk IDAT at offset 0x800c78, length 32768
  chunk IDAT at offset 0x808c84, length 32768
  chunk IDAT at offset 0x810c90, length 32768
  chunk IDAT at offset 0x818c9c, length 32768
  chunk IDAT at offset 0x820ca8, length 32768
  chunk IDAT at offset 0x828cb4, length 32768
  chunk IDAT at offset 0x830cc0, length 32768
  chunk IDAT at offset 0x838ccc, length 32768
  chunk IDAT at offset 0x840cd8, length 32768
  chunk IDAT at offset 0x848ce4, length 32768
  chunk IDAT at offset 0x850cf0, length 32768
  chunk IDAT at offset 0x858cfc, length 32768
  chunk IDAT at offset 0x860d08, length 32768
  chunk IDAT at offset 0x868d14, length 32768
  chunk IDAT at offset 0x870d20, length 32768
  chunk IDAT at offset 0x878d2c, length 32768
  chunk IDAT at offset 0x880d38, length 32768
  chunk IDAT at offset 0x888d44, length 32768
  chunk IDAT at offset 0x890d50, length 32768
  chunk IDAT at offset 0x898d5c, length 32768
  chunk IDAT at offset 0x8a0d68, length 32768
  chunk IDAT at offset 0x8a8d74, length 32768
  chunk IDAT at offset 0x8b0d80, length 32768
  chunk IDAT at offset 0x8b8d8c, length 12478
  chunk IEND at offset 0x8bbe56, length 0
No errors detected in trim.png (285 chunks, 82.1% compression).
here is an identify output

Code: Select all

# identify -verbose trim.png            
Image: trim.png
  Format: PNG (Portable Network Graphics)
  Mime type: image/png
  Class: DirectClass
  Geometry: 3148x4055+0+0
  Resolution: 478.34x478.34
  Print size: 6.58109x8.47723
  Units: PixelsPerCentimeter
  Type: TrueColorAlpha
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 1-bit
  Channel statistics:
    Pixels: 12765140
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 246.909 (0.968272)
      standard deviation: 27.0745 (0.106174)
      kurtosis: 43.4289
      skewness: -5.99989
      entropy: 0.276577
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 241.314 (0.946329)
      standard deviation: 35.0938 (0.137623)
      kurtosis: 17.1845
      skewness: -3.74818
      entropy: 0.301701
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 230.647 (0.904497)
      standard deviation: 52.4057 (0.205512)
      kurtosis: 4.10558
      skewness: -2.19892
      entropy: 0.318425
    Alpha:
      min: 0 (0)
      max: 255 (1)
      mean: 55.1324 (0.216205)
      standard deviation: 104.972 (0.411656)
      kurtosis: -0.0989223
      skewness: -1.3788
      entropy: 0.0941472
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 229.684 (0.900723)
      standard deviation: 62.7099 (0.245921)
      kurtosis: 8.26207
      skewness: -3.15189
      entropy: 0.247712
  Alpha: srgba(255,255,255,0)   #FFFFFF00
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Background color: white
  Border color: srgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Interlace: PNG
  Intensity: Undefined
  Compose: Over
  Page geometry: 3148x4055+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    date:create: 2015-10-01T15:14:19+02:00
    date:modify: 2015-10-01T14:16:41+02:00
    png:bKGD: chunk was found (see Background color, above)
    png:cHRM: chunk was found (see Chromaticity, above)
    png:IHDR.bit-depth-orig: 8
    png:IHDR.bit_depth: 8
    png:IHDR.color-type-orig: 6
    png:IHDR.color_type: 6 (RGBA)
    png:IHDR.interlace_method: 1 (Adam7 method)
    png:IHDR.width,height: 3148, 4055
    png:pHYs: x_res=47834, y_res=47834, units=1
    png:sRGB: intent=0 (Perceptual Intent)
    signature: 1b2de8cdec0f61064251d6460fd8c37c3a77d0903f9179c011b7a2912f9ad6af
  Artifacts:
    filename: trim.png
    verbose: true
  Tainted: False
  Filesize: 9.158MB
  Number pixels: 12.77M
  Pixels per second: 271.6GB
  User time: 0.000u
  Elapsed time: 0:01.000
  Version: ImageMagick 6.9.2-0 Q16 x86_64 2015-10-01 http://www.imagemagick.org
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: IM 6.9.2 crash with some PNG

Post by dlemstra »

Thanks for providing the image (too bad we don't get whats on it :) ). We are able to reproduce the issue and just pushed a fix for this to our GIT repository. Your issue will be fixed in the next release of ImageMagick (6.9.2-4) that will be published soon.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
kriks
Posts: 114
Joined: 2008-01-04T05:52:03-07:00

Re: IM 6.9.2 crash with some PNG

Post by kriks »

Thank you very much!
Can you tell me what was the problem ?
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: IM 6.9.2 crash with some PNG

Post by dlemstra »

The problem was in the -split operation. It was accessing pixels outside the image and that caused an access violation.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply