You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 are memory leaks detected in AcquireMagickMemory
Steps to Reproduce
poc
please run a following cmd with poc file. magick $PoC -depth 41 -strokewidth 70 tmp.miff
Here's ASAN log.
=================================================================
==12005==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 6144 byte(s) in 1 object(s) allocated from:
#0 0x4e53e0 in __interceptor_malloc (magick+0x4e53e0)
#1 0x6c1d14 in AcquireMagickMemory ImageMagick/MagickCore/memory.c:478:10
#2 0x6c1e25 in AcquireQuantumMemory ImageMagick/MagickCore/memory.c:551:10
#3 0x16fe728 in WriteMIFFImage ImageMagick/coders/miff.c:2443:36
#4 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#5 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#6 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#7 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#8 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#9 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#10 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#11 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#12 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#13 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
Direct leak of 1084 byte(s) in 1 object(s) allocated from:
#0 0x4e53e0 in __interceptor_malloc (magick+0x4e53e0)
#1 0x6c1d14 in AcquireMagickMemory ImageMagick/MagickCore/memory.c:478:10
#2 0x6c1e25 in AcquireQuantumMemory ImageMagick/MagickCore/memory.c:551:10
#3 0x16ed15a in WriteMIFFImage ImageMagick/coders/miff.c:2155:39
#4 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#5 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#6 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#7 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#8 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#9 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#10 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#11 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#12 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#13 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
Direct leak of 152 byte(s) in 1 object(s) allocated from:
#0 0x4e53e0 in __interceptor_malloc (magick+0x4e53e0)
#1 0x6c1d14 in AcquireMagickMemory ImageMagick/MagickCore/memory.c:478:10
#2 0x3962c4c in AcquireCriticalMemory ImageMagick/./MagickCore/memory-private.h:64:10
#3 0x3962199 in AcquireQuantumInfo ImageMagick/MagickCore/quantum.c:119:32
#4 0x16e7303 in WriteMIFFImage ImageMagick/coders/miff.c:2097:18
#5 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#6 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#7 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#8 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#9 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#10 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#11 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#12 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#13 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#14 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
Indirect leak of 17088 byte(s) in 1 object(s) allocated from:
#0 0x4e6018 in __interceptor_posix_memalign (magick+0x4e6018)
#1 0x6c14da in AcquireAlignedMemory ImageMagick/MagickCore/memory.c:265:7
#2 0x6c2967 in AcquireVirtualMemory ImageMagick/MagickCore/memory.c:621:25
#3 0x3976b3e in AcquireQuantumPixels ImageMagick/MagickCore/quantum.c:177:29
#4 0x396b0d0 in SetQuantumDepth ImageMagick/MagickCore/quantum.c:696:10
#5 0x396264f in AcquireQuantumInfo ImageMagick/MagickCore/quantum.c:124:10
#6 0x16e7303 in WriteMIFFImage ImageMagick/coders/miff.c:2097:18
#7 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#8 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#9 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#10 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#11 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#12 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#13 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#14 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#15 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#16 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
Indirect leak of 4160 byte(s) in 1 object(s) allocated from:
#0 0x4e6018 in __interceptor_posix_memalign (magick+0x4e6018)
#1 0x6c14da in AcquireAlignedMemory ImageMagick/MagickCore/memory.c:265:7
#2 0x6c20b2 in AcquireVirtualMemory ImageMagick/MagickCore/memory.c:610:30
#3 0x3976b3e in AcquireQuantumPixels ImageMagick/MagickCore/quantum.c:177:29
#4 0x396b0d0 in SetQuantumDepth ImageMagick/MagickCore/quantum.c:696:10
#5 0x396264f in AcquireQuantumInfo ImageMagick/MagickCore/quantum.c:124:10
#6 0x16e7303 in WriteMIFFImage ImageMagick/coders/miff.c:2097:18
#7 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#8 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#9 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#10 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#11 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#12 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#13 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#14 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#15 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#16 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
Indirect leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x4e6018 in __interceptor_posix_memalign (magick+0x4e6018)
#1 0xa1afbe in AcquireSemaphoreMemory ImageMagick/MagickCore/semaphore.c:154:7
#2 0xa18c0d in AcquireSemaphoreInfo ImageMagick/MagickCore/semaphore.c:200:36
#3 0x39639fe in GetQuantumInfo ImageMagick/MagickCore/quantum.c:430:27
#4 0x39623aa in AcquireQuantumInfo ImageMagick/MagickCore/quantum.c:121:3
#5 0x16e7303 in WriteMIFFImage ImageMagick/coders/miff.c:2097:18
#6 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#7 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#8 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#9 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#10 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#11 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#12 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#13 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#14 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#15 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
Indirect leak of 8 byte(s) in 1 object(s) allocated from:
#0 0x4e53e0 in __interceptor_malloc (magick+0x4e53e0)
#1 0x6c1d14 in AcquireMagickMemory ImageMagick/MagickCore/memory.c:478:10
#2 0x6c1e25 in AcquireQuantumMemory ImageMagick/MagickCore/memory.c:551:10
#3 0x3975cea in AcquireQuantumPixels ImageMagick/MagickCore/quantum.c:165:40
#4 0x396b0d0 in SetQuantumDepth ImageMagick/MagickCore/quantum.c:696:10
#5 0x396264f in AcquireQuantumInfo ImageMagick/MagickCore/quantum.c:124:10
#6 0x16e7303 in WriteMIFFImage ImageMagick/coders/miff.c:2097:18
#7 0x2b80945 in WriteImage ImageMagick/MagickCore/constitute.c:1163:16
#8 0x2b86c48 in WriteImages ImageMagick/MagickCore/constitute.c:1380:13
#9 0x678543f in CLINoImageOperator ImageMagick/MagickWand/operation.c:4825:14
#10 0x679bac4 in CLIOption ImageMagick/MagickWand/operation.c:5287:7
#11 0x59ed5ce in ProcessCommandOptions ImageMagick/MagickWand/magick-cli.c:529:3
#12 0x59f394c in MagickImageCommand ImageMagick/MagickWand/magick-cli.c:796:5
#13 0x59fd963 in MagickCommandGenesis ImageMagick/MagickWand/mogrify.c:185:14
#14 0x5200c5 in MagickMain ImageMagick/utilities/magick.c:149:10
#15 0x51d949 in main ImageMagick/utilities/magick.c:180:10
#16 0x7f3f8c43cb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
SUMMARY: AddressSanitizer: 28700 byte(s) leaked in 7 allocation(s).
Prerequisites
Description
There are memory leaks detected in AcquireMagickMemory
Steps to Reproduce
poc
please run a following cmd with poc file.
magick $PoC -depth 41 -strokewidth 70 tmp.miff
Here's ASAN log.
System Configuration
ImageMagick version:
Version: ImageMagick 7.0.8-69 Q16 x86_64 2019-10-15 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-6 CXX=clang++6 CFLAGS="-fsanitize=address,undefined -g" CXXFLAGS="-fsanitize=address,undefined -g" ./configure --disable-openmp
The text was updated successfully, but these errors were encountered: