I am able to reproduce this. It appears to be peculiar to writing to the
TIFF writer since I tried several other output formats and the problem
did not happen.
The issue appears to be related to the I/O 'blob' reference count which
results in destroying an underlying blob which was already destroyed.
This is towards the end of
valgrind --tool=memcheck --leak-check=summary --read-var-info=yes
--error-exitcode=2 --track-origins=yes --num-callers=12 --quiet
on the command
gm convert -debug blob image.tif +adjoin image_%04d.tif
11:37:38 0:0.474968 0.470u 3758172 blob.c/DestroyBlob/1209/Blob:
Destroy blob (ref counted): image 0x9fe3d20, blob 0xa01a060, ref 1, filename
"image_0001.tif"
11:37:38 0:0.475144 0.470u 3758172 blob.c/DestroyBlob/1226/Blob:
Destroy blob (real): image 0x9fe3d20, blob 0xa01a060, ref 0, filename
"image_0001.tif"
11:37:38 0:0.475434 0.470u 3758172 blob.c/CloseBlob/957/Blob:
Closing FileStream blob: image 0x9fe3d20, blob 0xa01a060, ref 0
11:37:38 0:0.475595 0.470u 3758172 blob.c/CloseBlob/961/Blob:
Blob wrote 293 bytes, read 0 bytes
==3758172== Syscall param write(buf) points to unaddressable byte(s)
Bob
On 8/29/26 10:11, Alexis Bienvenüe wrote:
Package: graphicsmagick
Version: 1.4+really1.3.48-1
Severity: normal
Tags: upstream
Dear Maintainer,
The GraphicsMagick command fails when decomposing a (three or more) multiple
frames tiff image to multiple tiff images. For example:
gm convert -size 10x10xc:black image1.tif
gm convert image1.tif image1.tif image1.tif image.tif
gm identify image.tif
gm convert image.tif +adjoin image_%04d.tif
leads to the output:
image.tif[0] TIFF 10x10+0+0 DirectClass 1-bit 860 0.000u 0m:0.000005s
image.tif[1] TIFF 10x10+0+0 DirectClass 1-bit 860 0.000u 0m:0.000039s
image.tif[2] TIFF 10x10+0+0 DirectClass 1-bit 860 0.000u 0m:0.000033s
double free or corruption (out)
gm convert: abort due to signal 6 (SIGABRT) "Abort"...
Aborted
even if the output images image_0000.tif, image_0001.tif and image_0002.tif are
properly generated.
This runs with no error when image.tif contains only two frames, and when
requesting a jpg output image_%04d.jpg
These commands run with no error with version
libgraphicsmagick-q16-3t64=1.4+really1.3.45+hg17696-1
Thanks,
Alexis Bienvenüe.
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (1200, 'testing'), (1000, 'stable'), (200, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 7.1.8+deb14.1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages graphicsmagick depends on:
ii libc6 2.43-3
ii libgraphicsmagick-q16-3t64 1.4+really1.3.48-1
graphicsmagick recommends no packages.
Versions of packages graphicsmagick suggests:
pn graphicsmagick-dbg <none>
-- no debconf information