Skip to content
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 is detected at AcquireMagickMemory #1616

Closed
3 tasks done
SuhwanSong opened this issue Jun 23, 2019 · 2 comments
Closed
3 tasks done

memory leaks is detected at AcquireMagickMemory #1616

SuhwanSong opened this issue Jun 23, 2019 · 2 comments
Labels
Milestone

Comments

@SuhwanSong
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

There's memory leaks in MagickCore/memory.c:478:10
This issue is maybe related with #1604.

Steps to Reproduce

run_cmd:
magick -seed 0 -quality 3 "(" magick:logo +repage ")" "(" magick:wizard +repage ")" -quiet -caption "%h%U" -compare -insert 2 tmp

Here's ASAN log.

==22113==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 13504 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c3e5114 in AcquireCriticalMemory ./MagickCore/memory-private.h:64:10
    #3 0x7f9c4c3e96c9 in CloneImage MagickCore/image.c:823:25
    #4 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #5 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #6 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #7 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #8 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #9 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #10 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #11 0x526f95 in MagickMain utilities/magick.c:149:10
    #12 0x5268e1 in main utilities/magick.c:180:10
    #13 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 6553600 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c437f26 in AcquireAlignedMemory MagickCore/memory.c:265:7
    #2 0x7f9c4c18061c in OpenPixelCache MagickCore/cache.c:3728:46
    #3 0x7f9c4c186901 in GetImagePixelCache MagickCore/cache.c:1754:18
    #4 0x7f9c4c16e330 in QueueAuthenticPixelCacheNexus MagickCore/cache.c:4156:28
    #5 0x7f9c4c16e001 in GetAuthenticPixelCacheNexus MagickCore/cache.c:1324:10
    #6 0x7f9c4c1909be in GetCacheViewAuthenticPixels MagickCore/cache-view.c:312:10
    #7 0x7f9c4c3f83a1 in SetImageAlpha MagickCore/image.c:2372:7
    #8 0x7f9c4c479695 in ConformPixelInfo MagickCore/pixel.c:235:12
    #9 0x7f9c4c3ec4a7 in SetImageBackgroundColor MagickCore/image.c:2441:3
    #10 0x7f9c4c5e88b5 in ExtentImage MagickCore/transform.c:1138:10
    #11 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #12 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #13 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #14 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #15 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #16 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #17 0x526f95 in MagickMain utilities/magick.c:149:10
    #18 0x5268e1 in main utilities/magick.c:180:10
    #19 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 22616 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c3eaafd in CloneImage MagickCore/image.c:879:43
    #4 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #5 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #6 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #7 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #8 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #9 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #10 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #11 0x526f95 in MagickMain utilities/magick.c:149:10
    #12 0x5268e1 in main utilities/magick.c:180:10
    #13 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 13024 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c3e5114 in AcquireCriticalMemory ./MagickCore/memory-private.h:64:10
    #3 0x7f9c4c3e7753 in AcquireImageInfo MagickCore/image.c:350:28
    #4 0x7f9c4c3f0513 in CloneImageInfo MagickCore/image.c:945:14
    #5 0x7f9c4c3e7678 in SyncImageSettings MagickCore/image.c:4242:21
    #6 0x7f9c4c3fee66 in SyncImagesSettings MagickCore/image.c:4000:12
    #7 0x7f9c4bbbc163 in CLIOption MagickWand/operation.c:5246:14
    #8 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #9 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #10 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #11 0x526f95 in MagickMain utilities/magick.c:149:10
    #12 0x5268e1 in main utilities/magick.c:180:10
    #13 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 9152 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c437f26 in AcquireAlignedMemory MagickCore/memory.c:265:7
    #2 0x7f9c4c16aa04 in AcquirePixelCache MagickCore/cache.c:195:28
    #3 0x7f9c4c16bf8d in ClonePixelCache MagickCore/cache.c:513:28
    #4 0x7f9c4c3eb59f in CloneImage MagickCore/image.c:910:22
    #5 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #6 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #7 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #8 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #9 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #10 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #11 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #12 0x526f95 in MagickMain utilities/magick.c:149:10
    #13 0x5268e1 in main utilities/magick.c:180:10
    #14 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c478f3a in AcquirePixelChannelMap MagickCore/pixel.c:101:35
    #4 0x7f9c4c479114 in ClonePixelChannelMap MagickCore/pixel.c:139:13
    #5 0x7f9c4c3ea34f in CloneImage MagickCore/image.c:849:28
    #6 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #7 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #8 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #9 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 288 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c148284 in AcquireCriticalMemory ./MagickCore/memory-private.h:64:10
    #3 0x7f9c4c149d5d in CloneBlobInfo MagickCore/blob.c:554:27
    #4 0x7f9c4c3ea808 in CloneImage MagickCore/image.c:867:25
    #5 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #6 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #7 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #8 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #9 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #10 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #11 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #12 0x526f95 in MagickMain utilities/magick.c:149:10
    #13 0x5268e1 in main utilities/magick.c:180:10
    #14 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 192 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c16b5df in AcquirePixelCacheNexus MagickCore/cache.c:271:29
    #4 0x7f9c4c16af8d in AcquirePixelCache MagickCore/cache.c:212:26
    #5 0x7f9c4c16bf8d in ClonePixelCache MagickCore/cache.c:513:28
    #6 0x7f9c4c3eb59f in CloneImage MagickCore/image.c:910:22
    #7 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #8 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #9 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #10 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #11 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #12 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #13 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #14 0x526f95 in MagickMain utilities/magick.c:149:10
    #15 0x5268e1 in main utilities/magick.c:180:10
    #16 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c593033 in AddValueToSplayTree MagickCore/splay-tree.c:189:21
    #3 0x7f9c4c593f3c in CloneSplayTree MagickCore/splay-tree.c:372:12
    #4 0x7f9c4c4c8ee3 in CloneImageProperties MagickCore/property.c:196:25
    #5 0x7f9c4c3e9f59 in CloneImage MagickCore/image.c:839:10
    #6 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #7 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #8 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #9 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c598084 in AcquireCriticalMemory ./MagickCore/memory-private.h:64:10
    #3 0x7f9c4c594115 in NewSplayTree MagickCore/splay-tree.c:1148:32
    #4 0x7f9c4c593d24 in CloneSplayTree MagickCore/splay-tree.c:360:14
    #5 0x7f9c4c4c8ee3 in CloneImageProperties MagickCore/property.c:196:25
    #6 0x7f9c4c3e9f59 in CloneImage MagickCore/image.c:839:10
    #7 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #8 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #9 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #10 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #11 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #12 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #13 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #14 0x526f95 in MagickMain utilities/magick.c:149:10
    #15 0x5268e1 in main utilities/magick.c:180:10
    #16 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 88 byte(s) in 1 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c598084 in AcquireCriticalMemory ./MagickCore/memory-private.h:64:10
    #3 0x7f9c4c594115 in NewSplayTree MagickCore/splay-tree.c:1148:32
    #4 0x7f9c4c593d24 in CloneSplayTree MagickCore/splay-tree.c:360:14
    #5 0x7f9c4c4698c0 in CloneImageOptions MagickCore/option.c:2144:27
    #6 0x7f9c4c3f2018 in CloneImageInfo MagickCore/image.c:1010:10
    #7 0x7f9c4c3e7678 in SyncImageSettings MagickCore/image.c:4242:21
    #8 0x7f9c4c3fee66 in SyncImagesSettings MagickCore/image.c:4000:12
    #9 0x7f9c4bbbc163 in CLIOption MagickWand/operation.c:5246:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c57d781 in AcquireSemaphoreMemory MagickCore/semaphore.c:154:7
    #2 0x7f9c4c57cfc3 in AcquireSemaphoreInfo MagickCore/semaphore.c:200:36
    #3 0x7f9c4c16b383 in AcquirePixelCache MagickCore/cache.c:231:30
    #4 0x7f9c4c16bf8d in ClonePixelCache MagickCore/cache.c:513:28
    #5 0x7f9c4c3eb59f in CloneImage MagickCore/image.c:910:22
    #6 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #7 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #8 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #9 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c57d781 in AcquireSemaphoreMemory MagickCore/semaphore.c:154:7
    #2 0x7f9c4c57cfc3 in AcquireSemaphoreInfo MagickCore/semaphore.c:200:36
    #3 0x7f9c4c16b2f4 in AcquirePixelCache MagickCore/cache.c:229:25
    #4 0x7f9c4c16bf8d in ClonePixelCache MagickCore/cache.c:513:28
    #5 0x7f9c4c3eb59f in CloneImage MagickCore/image.c:910:22
    #6 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #7 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #8 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #9 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c57d781 in AcquireSemaphoreMemory MagickCore/semaphore.c:154:7
    #2 0x7f9c4c57cfc3 in AcquireSemaphoreInfo MagickCore/semaphore.c:200:36
    #3 0x7f9c4c594389 in NewSplayTree MagickCore/splay-tree.c:1159:25
    #4 0x7f9c4c593d24 in CloneSplayTree MagickCore/splay-tree.c:360:14
    #5 0x7f9c4c4698c0 in CloneImageOptions MagickCore/option.c:2144:27
    #6 0x7f9c4c3f2018 in CloneImageInfo MagickCore/image.c:1010:10
    #7 0x7f9c4c3e7678 in SyncImageSettings MagickCore/image.c:4242:21
    #8 0x7f9c4c3fee66 in SyncImagesSettings MagickCore/image.c:4000:12
    #9 0x7f9c4bbbc163 in CLIOption MagickWand/operation.c:5246:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c437f26 in AcquireAlignedMemory MagickCore/memory.c:265:7
    #2 0x7f9c4c16b4e2 in AcquirePixelCacheNexus MagickCore/cache.c:267:29
    #3 0x7f9c4c16af8d in AcquirePixelCache MagickCore/cache.c:212:26
    #4 0x7f9c4c16bf8d in ClonePixelCache MagickCore/cache.c:513:28
    #5 0x7f9c4c3eb59f in CloneImage MagickCore/image.c:910:22
    #6 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #7 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #8 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #9 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 2 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c593033 in AddValueToSplayTree MagickCore/splay-tree.c:189:21
    #3 0x7f9c4c593f3c in CloneSplayTree MagickCore/splay-tree.c:372:12
    #4 0x7f9c4c4698c0 in CloneImageOptions MagickCore/option.c:2144:27
    #5 0x7f9c4c3f2018 in CloneImageInfo MagickCore/image.c:1010:10
    #6 0x7f9c4c3e7678 in SyncImageSettings MagickCore/image.c:4242:21
    #7 0x7f9c4c3fee66 in SyncImagesSettings MagickCore/image.c:4000:12
    #8 0x7f9c4bbbc163 in CLIOption MagickWand/operation.c:5246:14
    #9 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #10 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #11 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #12 0x526f95 in MagickMain utilities/magick.c:149:10
    #13 0x5268e1 in main utilities/magick.c:180:10
    #14 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c57d781 in AcquireSemaphoreMemory MagickCore/semaphore.c:154:7
    #2 0x7f9c4c57cfc3 in AcquireSemaphoreInfo MagickCore/semaphore.c:200:36
    #3 0x7f9c4c3ea99f in CloneImage MagickCore/image.c:871:26
    #4 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #5 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #6 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #7 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #8 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #9 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #10 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #11 0x526f95 in MagickMain utilities/magick.c:149:10
    #12 0x5268e1 in main utilities/magick.c:180:10
    #13 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c57d781 in AcquireSemaphoreMemory MagickCore/semaphore.c:154:7
    #2 0x7f9c4c57cfc3 in AcquireSemaphoreInfo MagickCore/semaphore.c:200:36
    #3 0x7f9c4c14a1ae in GetBlobInfo MagickCore/blob.c:1745:24
    #4 0x7f9c4c149d6a in CloneBlobInfo MagickCore/blob.c:555:3
    #5 0x7f9c4c3ea808 in CloneImage MagickCore/image.c:867:25
    #6 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #7 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #8 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #9 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x4e6200 in __interceptor_posix_memalign (install/bin/magick+0x4e6200)
    #1 0x7f9c4c57d781 in AcquireSemaphoreMemory MagickCore/semaphore.c:154:7
    #2 0x7f9c4c57cfc3 in AcquireSemaphoreInfo MagickCore/semaphore.c:200:36
    #3 0x7f9c4c594389 in NewSplayTree MagickCore/splay-tree.c:1159:25
    #4 0x7f9c4c593d24 in CloneSplayTree MagickCore/splay-tree.c:360:14
    #5 0x7f9c4c4c8ee3 in CloneImageProperties MagickCore/property.c:196:25
    #6 0x7f9c4c3e9f59 in CloneImage MagickCore/image.c:839:10
    #7 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #8 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #9 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #10 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #11 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #12 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #13 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #14 0x526f95 in MagickMain utilities/magick.c:149:10
    #15 0x5268e1 in main utilities/magick.c:180:10
    #16 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 62 byte(s) in 3 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c5cb9d3 in ConstantString MagickCore/string.c:713:26
    #4 0x7f9c4c593f26 in CloneSplayTree MagickCore/splay-tree.c:373:7
    #5 0x7f9c4c4c8ee3 in CloneImageProperties MagickCore/property.c:196:25
    #6 0x7f9c4c3e9f59 in CloneImage MagickCore/image.c:839:10
    #7 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #8 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #9 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #10 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #11 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #12 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #13 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #14 0x526f95 in MagickMain utilities/magick.c:149:10
    #15 0x5268e1 in main utilities/magick.c:180:10
    #16 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 35 byte(s) in 3 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c5cb9d3 in ConstantString MagickCore/string.c:713:26
    #4 0x7f9c4c593ea1 in CloneSplayTree MagickCore/splay-tree.c:372:43
    #5 0x7f9c4c4c8ee3 in CloneImageProperties MagickCore/property.c:196:25
    #6 0x7f9c4c3e9f59 in CloneImage MagickCore/image.c:839:10
    #7 0x7f9c4c5e8885 in ExtentImage MagickCore/transform.c:1134:16
    #8 0x7f9c4c1c5d00 in CompareImages MagickCore/compare.c:188:20
    #9 0x7f9c4bbb06f1 in CLIListOperatorImages MagickWand/operation.c:3880:22
    #10 0x7f9c4bbbc35e in CLIOption MagickWand/operation.c:5279:14
    #11 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #12 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #13 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #14 0x526f95 in MagickMain utilities/magick.c:149:10
    #15 0x5268e1 in main utilities/magick.c:180:10
    #16 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c5cb9d3 in ConstantString MagickCore/string.c:713:26
    #4 0x7f9c4c593ea1 in CloneSplayTree MagickCore/splay-tree.c:372:43
    #5 0x7f9c4c4698c0 in CloneImageOptions MagickCore/option.c:2144:27
    #6 0x7f9c4c3f2018 in CloneImageInfo MagickCore/image.c:1010:10
    #7 0x7f9c4c3e7678 in SyncImageSettings MagickCore/image.c:4242:21
    #8 0x7f9c4c3fee66 in SyncImagesSettings MagickCore/image.c:4000:12
    #9 0x7f9c4bbbc163 in CLIOption MagickWand/operation.c:5246:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

Indirect leak of 7 byte(s) in 2 object(s) allocated from:
    #0 0x4e5397 in __interceptor_malloc (install/bin/magick+0x4e5397)
    #1 0x7f9c4c438106 in AcquireMagickMemory MagickCore/memory.c:478:10
    #2 0x7f9c4c43816f in AcquireQuantumMemory MagickCore/memory.c:551:10
    #3 0x7f9c4c5cb9d3 in ConstantString MagickCore/string.c:713:26
    #4 0x7f9c4c593f26 in CloneSplayTree MagickCore/splay-tree.c:373:7
    #5 0x7f9c4c4698c0 in CloneImageOptions MagickCore/option.c:2144:27
    #6 0x7f9c4c3f2018 in CloneImageInfo MagickCore/image.c:1010:10
    #7 0x7f9c4c3e7678 in SyncImageSettings MagickCore/image.c:4242:21
    #8 0x7f9c4c3fee66 in SyncImagesSettings MagickCore/image.c:4000:12
    #9 0x7f9c4bbbc163 in CLIOption MagickWand/operation.c:5246:14
    #10 0x7f9c4b9fda99 in ProcessCommandOptions MagickWand/magick-cli.c:477:7
    #11 0x7f9c4b9fed0a in MagickImageCommand MagickWand/magick-cli.c:796:5
    #12 0x7f9c4ba48ba1 in MagickCommandGenesis MagickWand/mogrify.c:185:14
    #13 0x526f95 in MagickMain utilities/magick.c:149:10
    #14 0x5268e1 in main utilities/magick.c:180:10
    #15 0x7f9c464bfb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: 6613792 byte(s) leaked in 32 allocation(s).

System Configuration

  • ImageMagick version:
    Version: ImageMagick 7.0.8-50 Q16 x86_64 2019-06-23 https://imagemagick.org

  • Environment (Operating system, version and so on):
    Description: Ubuntu 18.04.1 LTS
    Release: 18.04
    Codename: bionic

  • Additional information:
    CC=clang-7 CXX=clang++-7 ./configure --disable-openmp

urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue Jun 23, 2019
@urban-warrior
Copy link
Contributor

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 @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

@nohmask
Copy link

nohmask commented Jul 8, 2019

This was assigned CVE-2019-13309 and CVE-2019-13310.

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

No branches or pull requests

4 participants