• Bug#1067829: nfs-utils: FTBFS on arm{el,hf}: export-cache.c:110:51: err

    From Sebastian Ramacher@21:1/5 to All on Wed Mar 27 11:10:01 2024
    Source: nfs-utils
    Version: 1:2.6.4-3
    Severity: serious
    Tags: ftbfs
    Justification: fails to build from source (but built successfully in the past) X-Debbugs-Cc: sramacher@debian.org

    https://buildd.debian.org/status/fetch.php?pkg=nfs-utils&arch=armel&ver=1%3A2.6.4-3%2Bb2&stamp=1711452552&raw=0

    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -I/usr/include/libxml2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-
    prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=
    overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -Werror=
    implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -c xml.c -fPIC -DPIC -o .libs/xml.o
    export-cache.c: In function ‘junction_flush_exports_cache’: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
    110 | snprintf(flushtime, sizeof(flushtime), "%ld\n", now);
    | ~~^ ~~~
    | | |
    | | time_t {aka long long int}
    | long int
    | %lld
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -I/usr/include/libxml2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-
    prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=
    overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -Werror=
    implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -c display.c -o display.o >/dev/null 2>&1
    cc1: some warnings being treated as errors
    make[3]: *** [Makefile:489: export-cache.lo] Error 1
    make[3]: *** Waiting for unfinished jobs....

    Cheers
    --
    Sebastian Ramacher

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Emanuele Rocca@21:1/5 to Sebastian Ramacher on Thu Mar 28 17:20:01 2024
    Control: tags -1 + patch

    Hi,

    On 2024-03-27 11:02, Sebastian Ramacher wrote:
    export-cache.c: In function ‘junction_flush_exports_cache’: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
    110 | snprintf(flushtime, sizeof(flushtime), "%ld\n", now);
    | ~~^ ~~~
    | | |
    | | time_t {aka long long int}
    | long int
    | %lld

    The attached patch by Vladimir Petko was sent upstream and fixes the
    FTBFS on armhf/armel.

    Emanuele

    diff -Nru nfs-utils-2.6.4/debian/changelog nfs-utils-2.6.4/debian/changelog
    --- nfs-utils-2.6.4/debian/changelog 2023-12-03 14:58:30.000000000 +0100
    +++ nfs-utils-2.6.4/debian/changelog 2024-03-28 16:56:19.000000000 +0100
    @@ -1,3 +1,10 @@
    +nfs-utils (1:2.6.4-3.1) unstable; urgency=medium
    +
    + * Non-maintainer upload.
    + * Apply upstream patch to fix FTBFS on armhf/armel (Closes: #1067829)
    +
    + -- Emanuele Rocca <ema@debian.org> Thu, 28 Mar 2024 16:56:19 +0100
    +
    nfs-utils (1:2.6.4-3) unstable; urgency=medium

    [ Salvatore Bonaccorso ]
    diff -Nru nfs-utils-2.6.4/debian/patches/flushtime-long-long-int.patch nfs-utils-2.6.4/debian/patches/flushtime-long-long-int.patch
    --- nfs-utils-2.6.4/debian/patches/flushtime-long-long-int.patch 1970-01-01 01:00:00.000000000 +0100
    +++ nfs-utils-2.6.4/debian/patches/flushtime-long-long-int.patch 2024-03-28 16:56:19.000000000 +0100
    @@ -0,0 +1,17 @@
    +Author: Vladimir Petko
    +Origin: https://bugzilla.kernel.org/show_bug.cgi?id=218540
    +Bug-Debian: https://bugs.debian.org/1067829
    +
    +Index: nfs-utils-2.6.4/support/junction/export-cache.
  • From Debian Bug Tracking System@21:1/5 to All on Thu Mar 28 17:20:01 2024
    Processing control commands:

    tags -1 + patch
    Bug #1067829 [src:nfs-utils] nfs-utils: FTBFS on arm{el,hf}: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
    Added tag(s) patch.

    --
    1067829: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067829
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thorsten Glaser@21:1/5 to All on Thu Mar 28 21:30:02 2024
    Emanuele Rocca dixit:

    The attached patch by Vladimir Petko was sent upstream and fixes the
    FTBFS on armhf/armel.

    The patch is catastrophically wrong.

    +- snprintf(flushtime, sizeof(flushtime), "%ld\n", now);
    ++ snprintf(flushtime, sizeof(flushtime), "%lld\n", now);

    Change that to:

    ++ snprintf(flushtime, sizeof(flushtime), "%lld\n", (long long)now);

    time_t is not guaranteed to be 64-bit (or even integer, by ISO C),
    it must always be coerced into the expected type for printf.

    Please forward this upstream as well.

    Might as well want to check that flushtime is large enough, too.

    bye,
    //mirabilos
    --
    When he found out that the m68k port was in a pretty bad shape, he did
    not, like many before him, shrug and move on; instead, he took it upon
    himself to start compiling things, just so he could compile his shell.
    How's that for dedication. -- Wouter, about my Debian/m68k revival

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Salvatore Bonaccorso@21:1/5 to All on Sat Apr 6 21:20:01 2024
    Hi Chuck, hi Steve,

    In Debian, as you might have heard there is a 64bit time_t
    transition[1] ongoing affecting the armel and armhf architectures.
    While doing so, nfs-utils was found to fail to build for those
    architectures after the switch, reported in Debian as [2]. Vladimir
    Petko from Ubuntu has as well filled it in [3].

    [1]: https://lists.debian.org/debian-devel-announce/2024/02/msg00005.html
    [2]: https://bugs.debian.org/1067829
    [3]: https://bugzilla.kernel.org/show_bug.cgi?id=218540

    The report is full-quoted below.

    Vladimir Petko has created a patch in the bugzilla which I'm attaching
    here as well. If this is not an acceptable format due to missing
    Signed-off's I'm attaching a variant with a Suggested-by for Vladimir
    to properly credit the patch origin.

    Let me know if that works. I changed it slightly and only casting to
    long long, and made it almost checkpatch clean.

    Regards,
    Salvatore

    ----- Forwarded message from Sebastian Ramacher <sramacher@debian.org> -----

    From: Sebastian Ramacher <sramacher@debian.org>
    Resent-From: Sebastian Ramacher <sramacher@debian.org>
    Reply-To: Sebastian Ramacher <sramacher@debian.org>, 1067829@bugs.debian.org Date: Wed, 27 Mar 2024 11:02:25 +0100
    To: Debian Bug Tracking System <submit@bugs.debian.org>
    Subject: Bug#1067829: nfs-utils: FTBFS on arm{el,hf}: export-cache.c:110:51: error: format ‘%ld’ expects argument of
    type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
    Delivered-To: submit@bugs.debian.org
    Message-ID: <ZgPusfnkCCvhalve@ramacher.at>

    Source: nfs-utils
    Version: 1:2.6.4-3
    Severity: serious
    Tags: ftbfs
    Justification: fails to build from source (but built successfully in the past) X-Debbugs-Cc: sramacher@debian.org

    https://buildd.debian.org/status/fetch.php?pkg=nfs-utils&arch=armel&ver=1%3A2.6.4-3%2Bb2&stamp=1711452552&raw=0

    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -I/usr/include/libxml2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-
    prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=
    overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -Werror=
    implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -c xml.c -fPIC -DPIC -o .libs/xml.o
    export-cache.c: In function ‘junction_flush_exports_cache’: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
    110 | snprintf(flushtime, sizeof(flushtime), "%ld\n", now);
    | ~~^ ~~~
    | | |
    | | time_t {aka long long int}
    | long int
    | %lld
    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -I/usr/include/libxml2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-
    prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=
    overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -Werror=
    implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -c display.c -o display.o >/dev/null 2>&1
    cc1: some warnings being treated as errors
    make[3]: *** [Makefile:489: export-cache.lo] Error 1
    make[3]: *** Waiting for unfinished jobs....

    Cheers
    --
    Sebastian Ramacher

    ----- End forwarded message -----

    Description: cast to a type with a known size to ensure sprintf works
    Author: Vladimir Petko <vladimir.petko@canonical.com>
    Bug: https://bugzilla.kernel.org/show_bug.cgi?id=218540
    Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/2055349 Last-Update: 2024-02-29
    --- a/support/junction/export-cache.c
    +++ b/support/junction/export-cache.c
    @@ -107,7 +107,7 @@
    xlog(D_GENERAL, "%s: time(3) failed", __func__);
    return FEDFS_ERR_SVRFAULT;
    }
    - snprintf(flushtime, sizeof(flushtime), "%ld\n", now);
    + snprintf(flushtime, sizeof(flushtime), "%lld\n", (long long int)now);

    for (i = 0; junction_proc_files[i] != NULL; i++) {
    retval = junction_write_time(junction_proc_files[i], flushtime);

    From 774394df352c249775d51d5d6e3effa775096b4f Mon Sep 17 00:00:00 2001
    From: Salvatore Bonaccorso <carnil@debian.org>
    Date: Sat, 6 Apr 2024 20:48:43 +0200
    Subject: [PATCH] junction: export-cache: cast to a type with a known size to
    ensure sprintf works
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit

    As reported in Debian, with the 64bit time_t transition for the armel
    and armhf architecture, it was found that nfs-utils fails to compile
    with:

    libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/
  • From Debian Bug Tracking System@21:1/5 to All on Sun Apr 7 07:30:01 2024
    This is a multi-part message in MIME format...

    Your message dated Sun, 07 Apr 2024 05:21:43 +0000
    with message-id <E1rtKyN-005umv-AG@fasolo.debian.org>
    and subject line Bug#1067829: fixed in nfs-utils 1:2.6.4-4
    has caused the Debian Bug report #1067829,
    regarding nfs-utils: FTBFS on arm{el,hf}: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
    to be marked as done.

    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.

    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)


    --
    1067829: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067829
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    Received: (at submit) by bugs.debian.org; 27 Mar 2024 10:02:28 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
    (2021-04-09) on buxtehude.debian.org
    X-Spam-Level:
    X-Spam-Status: No, score=-105.1 required=4.0 tests=BAYES_00,DKIMWL_WL_HIGH,
    DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,
    FROMDEVELOPER,SPF_HELO_NONE,SPF_NONE,UNPARSEABLE_RELAY,
    USER_IN_DKIM_WELCOMELIST,USER_IN_DKIM_WHITELIST autolearn=ham
    autolearn_force=no version=3.4.6-bugs.debian.org_2005_01_02 X-Spam-Bayes: score:0.0000 Tokens: new, 25; hammy, 150; neutral, 104; spammy,
    0. spammytokens:
    hammytokens:0.000-+--Hx-spam-relays-external:sk:stravin,
    0.000-+--H*RT:sk:stravin, 0.000-+--Hx-spam-relays-external:311,
    0.000-+--H*RT:311, 0.000-+--H*RT:108
    Return-path: <sramacher@debian.org>
    Received: from stravinsky.debian.org ([2001:41b8:202:deb::31