New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory leaks in WriteOnePNGImage #902

Closed
henices opened this Issue Dec 19, 2017 · 3 comments

Comments

Projects
None yet
5 participants
@henices
Copy link
Contributor

henices commented Dec 19, 2017

/usr/local/bin/magick -version
Version: ImageMagick 7.0.7-16 Q16 x86_64 2017-12-19 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gvc jbig jng jpeg lcms lqr lzma pangocairo png rsvg tiff webp wmf x xml zlib

Trigger Command: magick convert 'memory-leaks-CySdxTUBH3AFFf8fpXeyNzsjxMbxmLvm.svg~' /dev/null

convert: cache resources exhausted `' @ error/cache.c/OpenPixelCache/3655.
convert: memory allocation failed `' @ error/png.c/WriteOnePNGImage/9256.

=================================================================
==22135==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 13488 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940af94a2 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7fd940afd9a6 in CloneImage MagickCore/image.c:826
    #4 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #5 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #6 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #7 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #8 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #9 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #10 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #11 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #12 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #13 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #14 0x401b16 in MagickMain utilities/magick.c:149
    #15 0x401d80 in main utilities/magick.c:180
    #16 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Direct leak of 13024 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940af94a2 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7fd940afbe4f in AcquireImageInfo MagickCore/image.c:346
    #4 0x7fd940afef90 in CloneImageInfo MagickCore/image.c:947
    #5 0x7fd940ff3311 in WriteOnePNGImage coders/png.c:8440
    #6 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #7 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #8 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #9 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #10 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #11 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #12 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #13 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #14 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #15 0x401b16 in MagickMain utilities/magick.c:149
    #16 0x401d80 in main utilities/magick.c:180
    #17 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 89472 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940b3e7dd in AcquireAlignedMemory MagickCore/memory.c:262
    #2 0x7fd940909245 in AcquireCacheNexusPixels MagickCore/cache.c:4724
    #3 0x7fd940909e54 in SetPixelCacheNexusPixels MagickCore/cache.c:4844
    #4 0x7fd940906066 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:3967
    #5 0x7fd9408f9cdb in GetAuthenticPixelCacheNexus MagickCore/cache.c:1236
    #6 0x7fd9408fa675 in GetAuthenticPixels MagickCore/cache.c:1407
    #7 0x7fd940ff77f0 in WriteOnePNGImage coders/png.c:8973
    #8 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #9 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #10 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #11 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #12 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #13 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #14 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #15 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #16 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401b16 in MagickMain utilities/magick.c:149
    #18 0x401d80 in main utilities/magick.c:180
    #19 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 65536 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940b3e931 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7fd9408e37e2 in ImageToBlob MagickCore/blob.c:1898
    #4 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #5 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #6 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #7 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #8 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #9 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #10 0x401b16 in MagickMain utilities/magick.c:149
    #11 0x401d80 in main utilities/magick.c:180
    #12 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 22616 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940b3e931 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7fd94092c151 in AcquireImageColormap MagickCore/colormap.c:119
    #4 0x7fd940ff94b9 in WriteOnePNGImage coders/png.c:9253
    #5 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #6 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #7 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #8 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #9 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #10 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #11 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #12 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #13 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #14 0x401b16 in MagickMain utilities/magick.c:149
    #15 0x401d80 in main utilities/magick.c:180
    #16 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 13024 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940af94a2 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7fd940afbe4f in AcquireImageInfo MagickCore/image.c:346
    #4 0x7fd940afef90 in CloneImageInfo MagickCore/image.c:947
    #5 0x7fd940afdf2d in CloneImage MagickCore/image.c:840
    #6 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #7 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #8 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #9 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #10 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #11 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #12 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #13 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #14 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #15 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #16 0x401b16 in MagickMain utilities/magick.c:149
    #17 0x401d80 in main utilities/magick.c:180
    #18 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 9096 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd9408f5258 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7fd9408f5381 in AcquirePixelCache MagickCore/cache.c:192
    #4 0x7fd9408f6219 in ClonePixelCache MagickCore/cache.c:411
    #5 0x7fd9408fb77f in GetImagePixelCache MagickCore/cache.c:1632
    #6 0x7fd940905cc5 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:3941
    #7 0x7fd9408f9cdb in GetAuthenticPixelCacheNexus MagickCore/cache.c:1236
    #8 0x7fd9408fa675 in GetAuthenticPixels MagickCore/cache.c:1407
    #9 0x7fd940ff77f0 in WriteOnePNGImage coders/png.c:8973
    #10 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #11 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #12 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #13 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #14 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #15 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #16 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #17 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #18 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #19 0x401b16 in MagickMain utilities/magick.c:149
    #20 0x401d80 in main utilities/magick.c:180
    #21 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 704 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940b3e931 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7fd9408f5ae7 in AcquirePixelCacheNexus MagickCore/cache.c:263
    #4 0x7fd9408f569e in AcquirePixelCache MagickCore/cache.c:206
    #5 0x7fd9408f6219 in ClonePixelCache MagickCore/cache.c:411
    #6 0x7fd9408fb77f in GetImagePixelCache MagickCore/cache.c:1632
    #7 0x7fd940905cc5 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:3941
    #8 0x7fd9408f9cdb in GetAuthenticPixelCacheNexus MagickCore/cache.c:1236
    #9 0x7fd9408fa675 in GetAuthenticPixels MagickCore/cache.c:1407
    #10 0x7fd940ff77f0 in WriteOnePNGImage coders/png.c:8973
    #11 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #12 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #13 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #14 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #15 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #16 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #17 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #18 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #19 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #20 0x401b16 in MagickMain utilities/magick.c:149
    #21 0x401d80 in main utilities/magick.c:180
    #22 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940b3e931 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7fd940b7461c in AcquirePixelChannelMap MagickCore/pixel.c:101
    #4 0x7fd940b747ad in ClonePixelChannelMap MagickCore/pixel.c:139
    #5 0x7fd940afe1f0 in CloneImage MagickCore/image.c:851
    #6 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #7 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #8 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #9 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #10 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #11 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #12 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #13 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #14 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #15 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #16 0x401b16 in MagickMain utilities/magick.c:149
    #17 0x401d80 in main utilities/magick.c:180
    #18 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 280 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd9408dc027 in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7fd9408dd1b2 in CloneBlobInfo MagickCore/blob.c:542
    #4 0x7fd940afe58c in CloneImage MagickCore/image.c:869
    #5 0x7fd940f56b9b in TraceSVGImage coders/svg.c:3633
    #6 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #7 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #8 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #9 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #10 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #11 0x401b16 in MagickMain utilities/magick.c:149
    #12 0x401d80 in main utilities/magick.c:180
    #13 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940c4cb0e in AcquireCriticalMemory MagickCore/memory-private.h:57
    #3 0x7fd940c50a36 in NewSplayTree MagickCore/splay-tree.c:1148
    #4 0x7fd940c4dbf6 in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x7fd940ba5582 in CloneImageProperties MagickCore/property.c:196
    #6 0x7fd940afdf88 in CloneImage MagickCore/image.c:842
    #7 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #8 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #9 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #10 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #11 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #12 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #13 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #14 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #15 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #16 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401b16 in MagickMain utilities/magick.c:149
    #18 0x401d80 in main utilities/magick.c:180
    #19 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940c3926e in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7fd940c39358 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7fd940afe68c in CloneImage MagickCore/image.c:873
    #4 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #5 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #6 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #7 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #8 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #9 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #10 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #11 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #12 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #13 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #14 0x401b16 in MagickMain utilities/magick.c:149
    #15 0x401d80 in main utilities/magick.c:180
    #16 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940c3926e in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7fd940c39358 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7fd940c50c27 in NewSplayTree MagickCore/splay-tree.c:1159
    #4 0x7fd940c4dbf6 in CloneSplayTree MagickCore/splay-tree.c:360
    #5 0x7fd940ba5582 in CloneImageProperties MagickCore/property.c:196
    #6 0x7fd940afdf88 in CloneImage MagickCore/image.c:842
    #7 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #8 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #9 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #10 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #11 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #12 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #13 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #14 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #15 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #16 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401b16 in MagickMain utilities/magick.c:149
    #18 0x401d80 in main utilities/magick.c:180
    #19 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940c4d047 in AddValueToSplayTree MagickCore/splay-tree.c:189
    #3 0x7fd940c4dd7f in CloneSplayTree MagickCore/splay-tree.c:372
    #4 0x7fd940ba5582 in CloneImageProperties MagickCore/property.c:196
    #5 0x7fd940afdf88 in CloneImage MagickCore/image.c:842
    #6 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #7 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #8 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #9 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #10 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #11 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #12 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #13 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #14 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #15 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #16 0x401b16 in MagickMain utilities/magick.c:149
    #17 0x401d80 in main utilities/magick.c:180
    #18 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940c3926e in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7fd940c39358 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7fd9408f5917 in AcquirePixelCache MagickCore/cache.c:223
    #4 0x7fd9408f6219 in ClonePixelCache MagickCore/cache.c:411
    #5 0x7fd9408fb77f in GetImagePixelCache MagickCore/cache.c:1632
    #6 0x7fd940905cc5 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:3941
    #7 0x7fd9408f9cdb in GetAuthenticPixelCacheNexus MagickCore/cache.c:1236
    #8 0x7fd9408fa675 in GetAuthenticPixels MagickCore/cache.c:1407
    #9 0x7fd940ff77f0 in WriteOnePNGImage coders/png.c:8973
    #10 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #11 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #12 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #13 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #14 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #15 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #16 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #17 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #18 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #19 0x401b16 in MagickMain utilities/magick.c:149
    #20 0x401d80 in main utilities/magick.c:180
    #21 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940c3926e in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7fd940c39358 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7fd9408e2911 in GetBlobInfo MagickCore/blob.c:1628
    #4 0x7fd9408dd1c2 in CloneBlobInfo MagickCore/blob.c:543
    #5 0x7fd940afe58c in CloneImage MagickCore/image.c:869
    #6 0x7fd940f56b9b in TraceSVGImage coders/svg.c:3633
    #7 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #8 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #9 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #10 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #11 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #12 0x401b16 in MagickMain utilities/magick.c:149
    #13 0x401d80 in main utilities/magick.c:180
    #14 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940c3926e in AcquireSemaphoreMemory MagickCore/semaphore.c:154
    #2 0x7fd940c39358 in AcquireSemaphoreInfo MagickCore/semaphore.c:200
    #3 0x7fd9408f58a7 in AcquirePixelCache MagickCore/cache.c:221
    #4 0x7fd9408f6219 in ClonePixelCache MagickCore/cache.c:411
    #5 0x7fd9408fb77f in GetImagePixelCache MagickCore/cache.c:1632
    #6 0x7fd940905cc5 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:3941
    #7 0x7fd9408f9cdb in GetAuthenticPixelCacheNexus MagickCore/cache.c:1236
    #8 0x7fd9408fa675 in GetAuthenticPixels MagickCore/cache.c:1407
    #9 0x7fd940ff77f0 in WriteOnePNGImage coders/png.c:8973
    #10 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #11 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #12 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #13 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #14 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #15 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #16 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #17 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #18 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #19 0x401b16 in MagickMain utilities/magick.c:149
    #20 0x401d80 in main utilities/magick.c:180
    #21 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7fd9417674a0 in posix_memalign (/lib64/libasan.so.4+0xdf4a0)
    #1 0x7fd940b3e7dd in AcquireAlignedMemory MagickCore/memory.c:262
    #2 0x7fd9408f59f6 in AcquirePixelCacheNexus MagickCore/cache.c:259
    #3 0x7fd9408f569e in AcquirePixelCache MagickCore/cache.c:206
    #4 0x7fd9408f6219 in ClonePixelCache MagickCore/cache.c:411
    #5 0x7fd9408fb77f in GetImagePixelCache MagickCore/cache.c:1632
    #6 0x7fd940905cc5 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:3941
    #7 0x7fd9408f9cdb in GetAuthenticPixelCacheNexus MagickCore/cache.c:1236
    #8 0x7fd9408fa675 in GetAuthenticPixels MagickCore/cache.c:1407
    #9 0x7fd940ff77f0 in WriteOnePNGImage coders/png.c:8973
    #10 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #11 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #12 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #13 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #14 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #15 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #16 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #17 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #18 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #19 0x401b16 in MagickMain utilities/magick.c:149
    #20 0x401d80 in main utilities/magick.c:180
    #21 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 52 byte(s) in 2 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940b3e931 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7fd940c77f34 in ConstantString MagickCore/string.c:700
    #4 0x7fd940c4dd13 in CloneSplayTree MagickCore/splay-tree.c:373
    #5 0x7fd940ba5582 in CloneImageProperties MagickCore/property.c:196
    #6 0x7fd940afdf88 in CloneImage MagickCore/image.c:842
    #7 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #8 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #9 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #10 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #11 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #12 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #13 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #14 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #15 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #16 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401b16 in MagickMain utilities/magick.c:149
    #18 0x401d80 in main utilities/magick.c:180
    #19 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

Indirect leak of 24 byte(s) in 2 object(s) allocated from:
    #0 0x7fd941766850 in malloc (/lib64/libasan.so.4+0xde850)
    #1 0x7fd940b3e8dd in AcquireMagickMemory MagickCore/memory.c:464
    #2 0x7fd940b3e931 in AcquireQuantumMemory MagickCore/memory.c:537
    #3 0x7fd940c77f34 in ConstantString MagickCore/string.c:700
    #4 0x7fd940c4dd6a in CloneSplayTree MagickCore/splay-tree.c:372
    #5 0x7fd940ba5582 in CloneImageProperties MagickCore/property.c:196
    #6 0x7fd940afdf88 in CloneImage MagickCore/image.c:842
    #7 0x7fd940ff32dd in WriteOnePNGImage coders/png.c:8437
    #8 0x7fd94100ca95 in WritePNGImage coders/png.c:12676
    #9 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #10 0x7fd9408e396a in ImageToBlob MagickCore/blob.c:1908
    #11 0x7fd940f56c3d in TraceSVGImage coders/svg.c:3639
    #12 0x7fd940f5751f in WriteSVGImage coders/svg.c:3749
    #13 0x7fd94096f3cd in WriteImage MagickCore/constitute.c:1114
    #14 0x7fd94097010a in WriteImages MagickCore/constitute.c:1333
    #15 0x7fd940198d6f in ConvertImageCommand MagickWand/convert.c:3280
    #16 0x7fd94029d25c in MagickCommandGenesis MagickWand/mogrify.c:183
    #17 0x401b16 in MagickMain utilities/magick.c:149
    #18 0x401d80 in main utilities/magick.c:180
    #19 0x7fd939e85039 in __libc_start_main (/lib64/libc.so.6+0x21039)

SUMMARY: AddressSanitizer: 228364 byte(s) leaked in 23 allocation(s).

testcase

Credit: NSFocus Security Team <security (at) nsfocus (dot) com>

@urban-warrior

This comment has been minimized.

Copy link
Contributor

urban-warrior commented Dec 19, 2017

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

urban-warrior pushed a commit that referenced this issue Dec 19, 2017

Cristy

urban-warrior pushed a commit that referenced this issue Dec 19, 2017

Cristy

@henices henices closed this Dec 20, 2017

@dlemstra dlemstra added the bug label Dec 20, 2017

@nohmask

This comment has been minimized.

Copy link

nohmask commented Dec 25, 2017

This was assigned CVE-2017-17884.

@pgajdos

This comment has been minimized.

Copy link

pgajdos commented Jan 16, 2018

Hi @dlemstra,

the testcase and command shows several leaks detected by valgrind for me with version 7.0.7-11 and 6.9.9-33, does it for you as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment