Message ID | 2b700a6dc4b5b7dd09465c0ef7c04f73b055d463.1658777229.git.marcel@hsdev.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id D5B3D27BBEA; Mon, 25 Jul 2022 20:58:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8D74827BBE9 for <patchwork@mira.cbaines.net>; Mon, 25 Jul 2022 20:58:17 +0100 (BST) Received: from localhost ([::1]:45178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org>) id 1oG4DY-0001qN-N7 for patchwork@mira.cbaines.net; Mon, 25 Jul 2022 15:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oG44d-00068n-5r for guix-patches@gnu.org; Mon, 25 Jul 2022 15:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oG44c-0002Tl-9Z for guix-patches@gnu.org; Mon, 25 Jul 2022 15:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1oG44c-0001y3-26 for guix-patches@gnu.org; Mon, 25 Jul 2022 15:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56766] [PATCH] gnu: exiv2: Fix test failure on ppc64-le Resent-From: Marcel van der Boom <marcel@van-der-boom.nl> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Jul 2022 19:49:01 +0000 Resent-Message-ID: <handler.56766.B.16587784927464@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56766@debbugs.gnu.org Cc: Marcel van der Boom <marcel@van-der-boom.nl> X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16587784927464 (code B ref -1); Mon, 25 Jul 2022 19:49:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jul 2022 19:48:12 +0000 Received: from localhost ([127.0.0.1]:51497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1oG43o-0001wI-3H for submit@debbugs.gnu.org; Mon, 25 Jul 2022 15:48:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:55226) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mrb@hsdev.com>) id 1oG43l-0001w1-Py for submit@debbugs.gnu.org; Mon, 25 Jul 2022 15:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mrb@hsdev.com>) id 1oG43l-00066n-Gu for guix-patches@gnu.org; Mon, 25 Jul 2022 15:48:09 -0400 Received: from read.hsdev.com ([209.250.245.235]:50726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mrb@hsdev.com>) id 1oG43i-0002Qa-Ul for guix-patches@gnu.org; Mon, 25 Jul 2022 15:48:09 -0400 Received: from hsdev.com (hawking.hsdev.com [213.125.12.142]) by read.hsdev.com (Postfix) with ESMTPA id 9F72020FBD; Mon, 25 Jul 2022 21:47:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hsdev.com; s=201906; t=1658778478; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=zNjIveHPv6FmvkLMlsWVafRuoHFJmJTu63bATmjspp4=; b=YKVfQ7VYy5qcJaUQQZucWqbpno00wVJxZcAoLwRiowah0Q/mVfI2C6R/JvifICHh6lbssn t8wfQRSqYBsvFXvV5wVSeNTz7TUyPopUtC1cJbzIo8R9j8I6ckbXcT7dtUyeBPhch+dHIk qec5QwQHUkjiE3fhpVgzZcP83yOi62M= Received: by hsdev.com (Postfix, from userid 1000) id 5A13B36A0264; Mon, 25 Jul 2022 21:47:58 +0200 (CEST) From: Marcel van der Boom <marcel@van-der-boom.nl> Date: Mon, 25 Jul 2022 21:47:33 +0200 Message-Id: <2b700a6dc4b5b7dd09465c0ef7c04f73b055d463.1658777229.git.marcel@hsdev.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=209.250.245.235; envelope-from=mrb@hsdev.com; helo=read.hsdev.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Mon, 25 Jul 2022 15:58:05 -0400 X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#56766] gnu: exiv2: Fix test failure on ppc64-le
|
|
Commit Message
Marcel van der Boom
July 25, 2022, 7:47 p.m. UTC
ppc64 and arm do not raise exception and thus output and exit code for test is different. * gnu/packages/patches/exiv2-ppc64.patch: Modify test for ppc64 * gnu/packages/image.scm (exiv2): add `patches` field for source if target is ppc64 See: https://github.com/Exiv2/exiv2/issues/365 and https://github.com/Exiv2/exiv2/issues/933 upstream. --- gnu/packages/image.scm | 5 ++++- gnu/packages/patches/exiv2-ppc64.patch | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/exiv2-ppc64.patch base-commit: 212ca81895b2baa819ea11a308ad21880b84a546
Comments
On 25-07-2022 21:47, Marcel van der Boom wrote: > + (patches > + (if (target-ppc64le?) > + (list (search-patch "exiv2-ppc64.patch")))))) The second branch of the 'if' is missing -- as-is, *unspecified* is used when (not (target-ppc64le?)), which won't work. The 'patches' field is delayed, not thunked, so only the first system+target it sees will take effect. This will break things if for whatever reason you compute the derivation of the package for multiple systems in the same process. To solve things, I recommend: 1. Inform upstream that the test (or the code it tests) is broken on ppc64le, such that a better test can be devised and everyone (not only Guix) benefits, 2. and for now, modify the test file in a phase (using 'substitute*') -- phases are thunked instead of delayed or direct, so the issue mentioned above doesn't hold. Greetings, Maxime.
On 25-07-2022 21:47, Marcel van der Boom wrote: > new file mode 100644 > index 0000000000..a74a7ac1b7 > --- /dev/null > +++ b/gnu/packages/patches/exiv2-ppc64.patch > @@ -0,0 +1,11 @@ > +--- /tests/bugfixes/github/test_CVE_2018_12265.py > ++++ /tests/bugfixes/github/test_CVE_2018_12265.py > +@@ -18,7 +18,6 @@ > + Warning: Directory Image, entry 0x0201: Strip 0 is outside of the data area; ignored. > + Warning: Directory Image, entry 0x0201: Strip 7 is outside of the data area; ignored. > + Error: Offset of directory Thumbnail, entry 0x0201 is out of bounds: Offset = 0x00000000; truncating the entry IIUC, "guix lint" has a linter that verifies that the patch contains a link to the upstream issue. It is also required to add an entry to gnu/local.mk, such that it is added to release tarballs. Greetings, Maxime.
Thanks for the review, some notes/questions inline below. [Maxime Devos]: > The 'patches' field is delayed, not thunked, so only the first > system+target it sees will take effect. This will break things > if for whatever reason you compute the derivation of the package > for multiple systems in the same process. Where can I read up on 'delayed' vs 'thunked' to understand that concept? I have no idea what it is at the moment and the manual does not mention this. > To solve things, I recommend: > 1. Inform upstream that the test (or the code it tests) is > broken on > ppc64le, such that a better test can be devised and everyone > (not > only Guix) benefits, This has been done. Their reply, in short: ppc64 is not on their supported platforms list and they delegate the fix to others. marcel
On 26-07-2022 20:38, Marcel van der Boom wrote: >> The 'patches' field is delayed, not thunked, so only the first >> system+target it sees will take effect. This will break things if for >> whatever reason you compute the derivation of the package for >> multiple systems in the same process. > > Where can I read up on 'delayed' vs 'thunked' to understand that > concept? I have no idea what it is at the moment and the manual does > not mention this. AFAICT, it is not documented, though you could read the code at (guix records). Basically: * thunked = field value is wrapped in a (lambda () the-value). This allows for target-specific inputs, as (inputs (list (if It's-this-architecture these those))) is internally translated to (inputs (lambda () (if [...] [...] [...]))). That way, the inputs are not decided when the package is being defined, but when it is compiled to a particular architecture on a particular architecture (or more precisely, a little before building, in what is called 'lowering', which is a bit of a low-level concept and hence probably not well-known). * delayed = field value is wrapped in a (delay the-value). For documentation on 'delay', see the manual. This is useful for avoiding computation until it's really needed, but unlike 'lambda', it will only be computed once, so only the first value of the-value is taken in account. As such, this won't work well when target-specific things are required. Greetings, Maxime.
>> 1. Inform upstream that the test (or the code it tests) is broken on >> ppc64le, such that a better test can be devised and everyone (not >> only Guix) benefits, > > This has been done. Their reply, in short: ppc64 is not on their > supported platforms list and they delegate the fix to others. OK, in that case ... On 25-07-2022 21:47, Marcel van der Boom wrote: > +--- /tests/bugfixes/github/test_CVE_2018_12265.py > ++++ /tests/bugfixes/github/test_CVE_2018_12265.py > +@@ -18,7 +18,6 @@ > + Warning: Directory Image, entry 0x0201: Strip 0 is outside of the data area; ignored. > + Warning: Directory Image, entry 0x0201: Strip 7 is outside of the data area; ignored. > + Error: Offset of directory Thumbnail, entry 0x0201 is out of bounds: Offset = 0x00000000; truncating the entry > +-$uncaught_exception $addition_overflow_message > + """ > + ] > +- retval = [1] > ++ retval = [0] ... this is your proposed fix for powerpc64le, but how do we know whether it is correct? Is this just rewriting the test until it passes, hiding the underlying overflow bug which even had an CVE so probably pretty important to not hide it and actually fix it, or do we know for a fact that on ppc64le, a retval = [0] is correct? Maybe this is answered by: > ppc64 and arm do not raise exception and thus output and exit code for test is different. but I don't know if that's working around symptoms or addressing the cause, e.g. https://github.com/Exiv2/exiv2/issues/933#issuecomment-863333032 noticed something on offsets -- summarised, this is not a sufficiently convincing explanation for me. Also, somehow this version of the package builds on Debian sid, so maybe Debian knows more, though I'm not finding anything relevant in the Debian package myself. Greetings, Maxime.
[Maxime Devos] > Also, somehow this version of the package builds on Debian sid, > so maybe Debian knows more, though I'm not finding anything > relevant in the Debian package myself. true, and I quickly ran a debian:sid container to see what they did, but they chose the same solution. That is, the exiv2 binary from their package returns the error as well (without the exception raising). So, I guess they dont run the test suite then as there's no change in their packaging. It gave me enough confidence though to use it locally and try to package it up in guix the same way. But I agree it's rather unsatisfactory. marcel
Anything else needed for this?
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index d52d57b3b1..dc4bf76790 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -1342,7 +1342,10 @@ (define-public exiv2 (uri (string-append "https://www.exiv2.org/builds/exiv2-" version "-Source.tar.gz")) (sha256 - (base32 "1qm6bvj28l42km009nc60gffn1qhngc0m2wjlhf90si3mcc8d99m")))) + (base32 "1qm6bvj28l42km009nc60gffn1qhngc0m2wjlhf90si3mcc8d99m")) + (patches + (if (target-ppc64le?) + (list (search-patch "exiv2-ppc64.patch")))))) (build-system cmake-build-system) (arguments '(#:test-target "tests" diff --git a/gnu/packages/patches/exiv2-ppc64.patch b/gnu/packages/patches/exiv2-ppc64.patch new file mode 100644 index 0000000000..a74a7ac1b7 --- /dev/null +++ b/gnu/packages/patches/exiv2-ppc64.patch @@ -0,0 +1,11 @@ +--- /tests/bugfixes/github/test_CVE_2018_12265.py ++++ /tests/bugfixes/github/test_CVE_2018_12265.py +@@ -18,7 +18,6 @@ + Warning: Directory Image, entry 0x0201: Strip 0 is outside of the data area; ignored. + Warning: Directory Image, entry 0x0201: Strip 7 is outside of the data area; ignored. + Error: Offset of directory Thumbnail, entry 0x0201 is out of bounds: Offset = 0x00000000; truncating the entry +-$uncaught_exception $addition_overflow_message + """ + ] +- retval = [1] ++ retval = [0]