Bug 1500681 - Use of uninitialized data causing compare to have random results
Summary: Use of uninitialized data causing compare to have random results
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ImageMagick
Version: 26
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michael Cronenworth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-11 10:38 UTC by Frediano Ziglio
Modified: 2017-11-15 20:17 UTC (History)
6 users (show)

Fixed In Version: ImageMagick-6.9.9.22-1.fc27 ImageMagick-6.9.9.22-1.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-14 14:20:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Example images to cause the issue (2.36 KB, application/octet-stream)
2017-10-11 10:38 UTC, Frediano Ziglio
no flags Details
New images with same issue (1.01 KB, application/octet-stream)
2017-10-12 07:54 UTC, Frediano Ziglio
no flags Details

Description Frediano Ziglio 2017-10-11 10:38:23 UTC
Created attachment 1337090 [details]
Example images to cause the issue

Description of problem:
The compare utility in the package 


Version-Release number of selected component (if applicable):
ImageMagick-6.9.9.13-1.fc26.x86_64


How reproducible:
Always


Steps to Reproduce:
1. extract the images in the attached file (images.tgz)
2. run: valgrind --tool=memcheck compare -metric AE in.png out.bmp - 2>&1 > /dev/null


Actual results:
No usage of uninitialized data
Not always "0"


Expected results:
Usage of uninitialized data
Results "0"


Additional info:
Upstream 7.0.7 version does not have this problem (compiled from sources)

Comment 1 Frediano Ziglio 2017-10-11 11:01:26 UTC
Just updated the system (Fedora 26), still having the issue,
Valgrind is reporting this first error:

==21502== Conditional jump or move depends on uninitialised value(s)
==21502==    at 0x4EAEBAC: GetAbsoluteDistortion._omp_fn.1 (compare.c:506)
==21502==    by 0x75ABCDE: GOMP_parallel (in /usr/lib64/libgomp.so.1.0.0)
==21502==    by 0x4EADAAD: GetAbsoluteDistortion (compare.c:458)
==21502==    by 0x4EB2ACE: GetImageChannelDistortion (compare.c:1625)
==21502==    by 0x4EB2C6E: CompareImageChannels (compare.c:202)
==21502==    by 0x532A5FA: CompareImageCommand (compare.c:1174)
==21502==    by 0x53AB833: MagickCommandGenesis (mogrify.c:172)
==21502==    by 0x108AB0: CompareMain (compare.c:84)
==21502==    by 0x108AB0: main (compare.c:101)
==21502==  Uninitialised value was created by a heap allocation
==21502==    at 0x4C30D47: memalign (vg_replace_malloc.c:857)
==21502==    by 0x4C30E45: posix_memalign (vg_replace_malloc.c:1020)
==21502==    by 0x4F6F694: AcquireAlignedMemory (memory.c:263)
==21502==    by 0x4E9795F: OpenPixelCache (cache.c:3918)
==21502==    by 0x4E79483: GetImagePixelCache (cache.c:1880)
==21502==    by 0x4E9A9EA: SyncImagePixelCache (cache.c:5611)
==21502==    by 0x10ADE674: ReadBMPImage (bmp.c:899)
==21502==    by 0x4EC3A8D: ReadImage (constitute.c:551)
==21502==    by 0x4EC4B4A: ReadImages (constitute.c:869)
==21502==    by 0x5328A23: CompareImageCommand (compare.c:378)
==21502==    by 0x53AB833: MagickCommandGenesis (mogrify.c:172)
==21502==    by 0x108AB0: CompareMain (compare.c:84)
==21502==    by 0x108AB0: main (compare.c:101)

Looks like the problem is reading this BMP image.

Comment 2 Fedora Update System 2017-10-11 19:02:28 UTC
rubygem-rmagick-2.16.0-8.fc27 ImageMagick-6.9.9.19-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-097791759e

Comment 3 Fedora Update System 2017-10-11 19:16:34 UTC
rubygem-rmagick-2.16.0-8.fc26 ImageMagick-6.9.9.19-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a62dd57720

Comment 4 Fedora Update System 2017-10-11 19:17:42 UTC
rubygem-rmagick-2.16.0-8.fc25 ImageMagick-6.9.9.19-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3c5282ada7

Comment 5 Frediano Ziglio 2017-10-12 07:54:06 UTC
Created attachment 1337575 [details]
New images with same issue

Updated with new packages but these images still present the issue.

Comment 6 Michael Cronenworth 2017-10-12 13:07:51 UTC
You will need to report this upstream:

https://github.com/ImageMagick/ImageMagick/issues

6.9.9-19 is the very latest version available at this time for the version 6 branch.

Comment 7 Frediano Ziglio 2017-10-12 13:11:45 UTC
Oh... tested last 7 version.
I'll try to compile from sources last 6 version and do same checks, just to confirm.

Comment 8 Frediano Ziglio 2017-10-12 13:29:37 UTC
Confirm.
Opened https://github.com/ImageMagick/ImageMagick/issues/835.

Comment 9 Fedora Update System 2017-10-13 04:23:09 UTC
ImageMagick-6.9.9.19-1.fc26, rubygem-rmagick-2.16.0-8.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a62dd57720

Comment 10 Fedora Update System 2017-10-13 04:50:43 UTC
ImageMagick-6.9.9.19-1.fc25, rubygem-rmagick-2.16.0-8.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3c5282ada7

Comment 11 Fedora Update System 2017-10-13 06:23:16 UTC
ImageMagick-6.9.9.19-1.fc27, rubygem-rmagick-2.16.0-8.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-097791759e

Comment 12 Frediano Ziglio 2017-10-13 12:03:38 UTC
Beta 6.9.9.20 fixed the issue.
All Fedora 6.9.9.19 versions still presents the issue.

Comment 13 Frediano Ziglio 2017-10-16 07:37:26 UTC
6.9.9.20 was released at https://www.imagemagick.org/download/.
Rebuilt the rpm package replacing 6.9.9.19 with 6.9.9.20 an compiled successfully the agent under mock (Fedora 26) with new ImageMagick packages.

Comment 14 Fedora Update System 2017-10-17 00:14:16 UTC
ImageMagick-6.9.9.19-1.fc27, rubygem-rmagick-2.16.0-8.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2017-10-18 17:18:55 UTC
ImageMagick-6.9.9.19-1.fc26, rubygem-rmagick-2.16.0-8.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2017-10-22 01:18:52 UTC
ImageMagick-6.9.9.19-1.fc25, rubygem-rmagick-2.16.0-8.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Frediano Ziglio 2017-10-22 16:27:57 UTC
The system keeps (wrongly) closing the bug!

Comment 18 Michael Cronenworth 2017-11-07 16:02:26 UTC
Pushing out 6.9.9-22 today.

Comment 19 Fedora Update System 2017-11-07 17:15:56 UTC
ImageMagick-6.9.9.22-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-9c0fc2975c

Comment 20 Fedora Update System 2017-11-07 19:16:00 UTC
ImageMagick-6.9.9.22-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-9c0fc2975c

Comment 21 Fedora Update System 2017-11-08 00:07:45 UTC
ImageMagick-6.9.9.22-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-357fa6205d

Comment 22 Frediano Ziglio 2017-11-13 15:17:23 UTC
Works for me

Comment 23 Fedora Update System 2017-11-14 00:55:56 UTC
ImageMagick-6.9.9.22-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2017-11-14 09:23:48 UTC
ImageMagick-6.9.9.22-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 25 Frediano Ziglio 2017-11-14 09:40:31 UTC
Package should be pushed to Fedora 26 stable too, currently for Fedora 26 is only in update-testing.

Comment 26 Michael Cronenworth 2017-11-14 14:20:39 UTC
Fediano, the Fedora update system has rules in place that require either karma or time (3 days for branched Fedora, 7 days for stable Fedora).

https://fedoraproject.org/wiki/Updates_Policy

There is no need to make comments or change the status of this bug. If you wish to push this update out faster you must add karma to the update as instructed by the automated comment above...

Fedora 26: https://bodhi.fedoraproject.org/updates/FEDORA-2017-357fa6205d

Comment 27 Fedora Update System 2017-11-15 20:17:30 UTC
ImageMagick-6.9.9.22-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.