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

Perl API change after 7.1.1-21? #6984

Closed
schmonz opened this issue Dec 29, 2023 · 6 comments
Closed

Perl API change after 7.1.1-21? #6984

schmonz opened this issue Dec 29, 2023 · 6 comments

Comments

@schmonz
Copy link

schmonz commented Dec 29, 2023

ImageMagick version

7.1.1-23

Operating system

Other (enter below)

Operating system, version and so on

NetBSD/amd64 9.3

Description

What I tried

I updated from ImageMagick and PerlMagick 7.1.1-21 to 7.1.1-23 on my development machine running macOS, saw no breakage on my staged websites, then performed the same update on my production server running NetBSD.

I performed the updates on both platforms the same way I always do, which is to install the latest versions from pkgsrc (here's the p5-PerlMagick package's commit history).

What I expected to happen

I anticipated no breakage on my production websites, given the changelog entries and the uneventful package updates on the macOS side.

What actually happened

In production, I saw image rendering errors from my web CMS (ikiwiki), of several kinds:

  • failed to determine size: all .jpg or .JPG
  • failed to get dimensions: some .gif, some .jpg, some .JPG
  • failed to read: all .png, followed by the message Exception 425: unable to read image data png:/correct/looking/path/to/file.png from error/constitute.c/ReadImage/991

The site contains approximately 200 images and I see about 160 errors.

What confuses me

What could account for PerlMagick behaving this differently on NetBSD from 7.1.1-21 to 7.1.1-23, especially when it behaves the same -- as we would all expect, presumably! -- on macOS between those same versions?

Has ikiwiki perhaps been invoking PerlMagick incorrectly for a while, and got lucky until just now? Here's the img plugin code (and end-user docs) where the errors are coming from.

I know this is far from a minimal reproducer. How would you suggest I try to narrow this down?

Steps to Reproduce

  1. On NetBSD, run ikiwiki --setup /path/to/mysite.setup
  2. In a browser, observe e.g. [[!img Error: failed to determine size of image images/cokebabies.jpg]] where the rendered image should be

Images

No response

@urban-warrior
Copy link
Member

First try the ImageMagick + PerlMagick unit tests:

$ cd ImageMagick-7.1.1
$ make check
$ cd PerlMagick
$ make test
$ cd demo
$ make

Do the unit tests complete? You can also replace PerlMagick/quantum/quantum.xs.in with the version from IMv 7.1.1.21. If that fixes the issue, the problem is isolated to PerlMagick.

@schmonz
Copy link
Author

schmonz commented Dec 29, 2023

On NetBSD/amd64 9.3, make check:

  • 7.1.1-21 fails 1 of 87 (tests/cli-pipe), passing the remaining 86
  • 7.1.1-22 fails 52 of 87, passing the remaining 35
  • 7.1.1-23 same as -22

Maybe the Perl bindings are fine, maybe not, but that's not our problem yet :-) I'll try bisecting -21 and -22 and report back.

@schmonz
Copy link
Author

schmonz commented Dec 29, 2023

On NetBSD/aarch64 10.0_RC1 (a very similar system that can bisect much faster):

  • Last "good" commit (still failing only 1/87 tests) was d8b38c26f
  • First "bad" commit (failing 55/87) was 86d2efbbb

What's my next useful step? I'm happy to try things, or if it'd be easiest for an ImageMagick developer to work on the problem(s) directly, I can easily provide SSH access to a NetBSD system.

@urban-warrior
Copy link
Member

urban-warrior commented Dec 30, 2023

Let's make this easy, we set up a temp email account, netbsd @ imagemagick.org. Provide access to a NetBSD system so we can do proper forensics. Thanks.

@schmonz schmonz changed the title Perl API change after 7.1.1.21? Perl API change after 7.1.1-21? Dec 30, 2023
urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue Dec 30, 2023
@urban-warrior
Copy link
Member

Thank you for reporting the issue. We have successfully reproduced it and are actively working on a patch to resolve it. You can expect this patch to be merged into the main GIT branch, later today. As part of our commitment to quality, this fix will also be included in the upcoming beta releases of ImageMagick by tomorrow. Your patience and feedback are greatly appreciated.

@schmonz
Copy link
Author

schmonz commented Dec 31, 2023

I applied this patch to my production 7.1.1-23 and can confirm my sites are back to rendering images normally. Thanks for the quick turnaround!

@schmonz schmonz closed this as completed Dec 31, 2023
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 31, 2023
7.1.1-25 - 2023-12-30

Merged

    When writing BMP to v3 or lower, ignore the ICC profile. #6979
    configure.ac: fixup LFS check for autoconf-2.72 #6978

Commits

    beta release 3e8b0fa
    beta release 0930653
    Correct flags for jpeg-xl build. 87f4a62
    Include deflate in the security/oss-fuzz build. 26e6cf7
    Include more features in the tiff build. 0d36830
    check for version 0.20 instead f5329ad
    Also include -ldeflate in the LIBS for the oss-fuzz build. a29b58c
    Corrected oss-fuzz build. c02326b
    display hidden image 1dfcae1
    Start of moving the oss-fuzz files. b333c1a
    cosmetic 1cec932
    latest autoconf/automake 44ca83b
    latest autoconf/automake update fd412d1
    identify image time-to-live 6aac882
    set errno if time-to-live exceeded a8a6a61
    cosmetic c59b334
    conditionally set errno to ESTALE 43a44ea
    cosmetic 371c8da
    Moved oss-fuzz files to a different folder. 75c72e1
    Changes due to moving the oss-fuzz files. abc23f1
    ensure video can be read from stdin (ImageMagick/ImageMagick#6980) 9a7e87a
    ignore SyncBlob() status in CloseBlob() (ImageMagick/ImageMagick#6984) 30274e5
    repo change ca392c7
    update manifest d4298ea
    release 054b98c
    release 98e7513

7.1.1-24 - 2023-12-25

Merged

    configure: drop backported ac_func_fseeko.m4 for autoconf-2.72 compat… #6970
    Add Panasonic Raw v2 (RW2) as mime type #6967
    Add Canon Raw v2 (CR2) as mime type #6968

Commits

    beta release 9e5eb3a
    ... 22ca517
    cosmetic 8d015de
    Added extra check for rare case when ImageMagick is build without any delegates. 8d08f85
    Corrected order to fix invalid matches. 935f2c2
    b10 should also be moved. cf821b1
    only fill the alpha channel for alpha floodfill ef87dfd
    Make sure we use the lt_ methods like we do elsewhere. da099f2
    support dng:max-raw-memory define (ImageMagick/ImageMagick#6922) 1b042b2
    cosmetic 8365814
    properly export YUV JP2 images (ImageMagick/ImageMagick#6943) 804e2b7
    use : specifier 66a3868
    correct display program name a0aca55
    check for corrupt DJVU images (https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-wv9p-78jx-g7fv) f65eba2
    support UTF-8 comments (ImageMagick/ImageMagick#6949) e46e2ef
    do not prefix iTxt key with 'png:' 558e255
    latest autoconf update 640af74
    enhance sampling factor parser (ImageMagick/ImageMagick#6943) 4011e63
    Corrected length check. 6c52fda
    Bump actions/download-artifact from 3 to 4 ed5ac6d
    Bump actions/upload-artifact from 3 to 4 be19e35
    Bump github/codeql-action from 2 to 3 b85f143
    Give artifacts a unique name. 1c229f2
    Use different name for the installers. 0813103
    Also include type in artifact name. 7d907ea
    Swap order. 490e9ab
    Switch to ubuntu 20.04 in the app-image build. 7f8aab2
    Revert path filter. 94d5512
    Corrected packages that need to be install due to ubuntu upgrade. 12ecacf
    Removed duplicate if statement. 092b8fa
    Bump actions/checkout from 3 to 4 854b3a4
    Silence warning d1cd21c
    improve accuracy of image statistics (ImageMagick/ImageMagick#6924) 1f241fd
    fx calculations of skewness and kurtosis (ImageMagick/ImageMagick#6964) fffda83
    Only write comments as itxt when the string contains non ansi chars. f21cd54
    check if the string contains non-Latin1 characters a07eac1
    Corrected patch to check for non-Latin1 characters. 73ad1b7
    invalid JSON with -ping (ImageMagick/ImageMagick#6966) 7ccf6e8
    throw exception if # of meta channels exceed max (https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-hx5j-pxvh-rj7r) 9c85f8f
    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-hx5j-pxvh-rj7r 8284632
    multiplication result converted to larger type c3bb6f6
    invalid HTTPS certificates are no longer ignored (https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-3r24-6m6q-vxmr) 62e67a2
    multiplication result converted to larger type 0882713
    eliminate compiler warning e88b9aa
    don't include the index channel in the overall image statistics 4e1feed
    multiplication result converted to larger type 91d8a32
    release 1c14ca3
    no member named 'rawparams' (ImageMagick/ImageMagick#6969) 57ff827
    release 883eaa2
    release 963f5fa
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