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 leak in identify -help #2889

Closed
3 tasks done
luisfrod opened this issue Nov 30, 2020 · 1 comment
Closed
3 tasks done

Memory leak in identify -help #2889

luisfrod opened this issue Nov 30, 2020 · 1 comment

Comments

@luisfrod
Copy link

luisfrod commented Nov 30, 2020

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

==15438==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 13024 byte(s) in 1 object(s) allocated from:
    #0 0x494bad in malloc (/usr/local/bin/magick+0x494bad)
    #1 0x7f5ee70c0a35 in AcquireMagickMemory MagickCore/memory.c:531:10
    #2 0x7f5ee70c0a4b in AcquireCriticalMemory MagickCore/memory.c:607:10
    #3 0x7f5ee7088a9f in AcquireImageInfo MagickCore/image.c:328:28
    #4 0x7f5ee708ef55 in CloneImageInfo MagickCore/image.c:924:14
    #5 0x7f5ee6b4ff84 in IdentifyImageCommand MagickWand/identify.c:249:3
    #6 0x7f5ee6b970f0 in MagickCommandGenesis MagickWand/mogrify.c:191:14
    #7 0x4c45ad in MagickMain utilities/magick.c:149:10
    #8 0x4c42a8 in main utilities/magick.c:180:10
    #9 0x7f5ee62070b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x494bad in malloc (/usr/local/bin/magick+0x494bad)
    #1 0x7f5ee70c0a35 in AcquireMagickMemory MagickCore/memory.c:531:10
    #2 0x7f5ee70c0c50 in AcquireQuantumMemory MagickCore/memory.c:649:10
    #3 0x7f5ee71e7d3e in ExpandFilenames MagickCore/utility.c:771:20
    #4 0x7f5ee6b4ffd9 in IdentifyImageCommand MagickWand/identify.c:258:10
    #5 0x7f5ee6b970f0 in MagickCommandGenesis MagickWand/mogrify.c:191:14
    #6 0x4c45ad in MagickMain utilities/magick.c:149:10
    #7 0x4c42a8 in main magick.c:180:10
    #8 0x7f5ee62070b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

Indirect leak of 15 byte(s) in 2 object(s) allocated from:
    #0 0x494bad in malloc (/usr/local/bin/magick+0x494bad)
    #1 0x7f5ee70c0a35 in AcquireMagickMemory MagickCore/memory.c:531:10
    #2 0x7f5ee70c0c50 in AcquireQuantumMemory MagickCore/memory.c:649:10
    #3 0x7f5ee71b8570 in ConstantString MagickCore/string.c:679:26
    #4 0x7f5ee71e7fad in ExpandFilenames MagickCore/utility.c:799:21
    #5 0x7f5ee6b4ffd9 in IdentifyImageCommand MagickWand/identify.c:258:10
    #6 0x7f5ee6b970f0 in MagickCommandGenesis MagickWand/mogrify.c:191:14
    #7 0x4c45ad in MagickMain utilities/magick.c:149:10
    #8 0x4c42a8 in main utilities/magick.c:180:10
    #9 0x7f5ee62070b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)

SUMMARY: AddressSanitizer: 13063 byte(s) leaked in 4 allocation(s).`

Steps to Reproduce

Just the help argument of the identify command:

identify -help

System Configuration

  • ImageMagick version: ImageMagick 7.0.10-45 Q16 x86_64
  • Environment (Operating system, version and so on): Ubuntu 20.04.1 LTS (GNU/Linux 4.4.0-19041-Microsoft x86_64)
  • Additional information: ./configure CC="clang" CFLAGS="-fsanitize=address -O1 -fno-omit-frame-pointer -g"
@dlemstra
Copy link
Member

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

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

No branches or pull requests

2 participants