[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#805884: marked as done (ion: FTBFS on sparc64, tv_usec wrong type in printf)



Your message dated Sat, 19 Nov 2022 15:37:56 +0000
with message-id <[🔎] E1owPum-004Qj2-HW@fasolo.debian.org>
and subject line Bug#1024339: Removed package(s) from unstable
has caused the Debian Bug report #805884,
regarding ion: FTBFS on sparc64, tv_usec wrong type in printf
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.)


-- 
805884: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=805884
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Source: ion
Severity: important
Tags: upstream patch
User: debian-sparc@lists.debian.org
Usertags: sparc64

Dear Maintainer,

The ion package currently fails to build on sparc64. The build log
can be seen here:

https://buildd.debian.org/status/fetch.php?pkg=ion&arch=sparc64&ver=3.2.1%2Bdfsg-1&stamp=1448045105

The error that stops the build is this:

   gcc -DHAVE_CONFIG_H -I. -I..   -D_FORTIFY_SOURCE=2 -I./dtnperf/al_bp/src/bp_implementations -I./dtnperf/al_bp/src -I./../bp/include -I./../bp/library -fmessage-length=0 -Dlinux -fno-strict-aliasing -DENABLE_BPACS -DENABLE_IMC -Wall -Werror -g -include ./../config.h  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -DNOEXPAT -c -o dtnperf/dtnperf/src/dtnperf_vION-csv_tools.o `test -f 'dtnperf/dtnperf/src/csv_tools.c' || echo './'`dtnperf/dtnperf/src/csv_tools.c
    dtnperf/dtnperf/src/csv_tools.c: In function 'csv_print_rx_time':
    dtnperf/dtnperf/src/csv_tools.c:24:15: error: format '%ld' expects argument of type 'long int', but argument 4 has type '__suseconds_t {aka int}' [-Werror=format=]
      sprintf(buf, "%ld.%ld;", result->tv_sec, result->tv_usec);
               ^  
    cc1: all warnings being treated as errors

What's happening is that Werror is enabled for format expressions and
in the sprintf call here:

    sprintf(buf, "%ld.%ld;", result->tv_sec, result->tv_usec);

The last argument 'result->tv_usec' does not match the flag '%ld'
which is for 'long'.  Apparantly on sparc64 'tv_usec' is type 'int'.
A simple solution which will work on all archs is to add a cast to
'long' to the fourth argument:

    sprintf(buf, "%ld.%ld;", result->tv_sec, (long)result->tv_usec);

On archs where 'tv_usec' is long the cast will do nothing and on
sparc64 the cast will widen the int to a long.

I've attached a patch that implements this change and which allows the
package to build on sparc64.

If you're going to suggest a change for upstream I'd ask them to
consider changing it to this:

    sprintf(buf, "%lld.%lld;", (long long)result->tv_sec, (long long)result->tv_usec);

By using the format flags for and casting to 'long long' the format
will work with any width of 'tv_sec' and 'tv_usec'. And because 'long
long' will be the widest integer on the platform it won't truncate
values.

Thanks!
David


-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: sparc64

Kernel: Linux 4.3.0-gentoo (SMP w/1 CPU core)
Locale: LANG=en_SG.UTF-8, LC_CTYPE=en_SG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
--- a/contrib/dtnperf/dtnperf/src/csv_tools.c
+++ b/contrib/dtnperf/dtnperf/src/csv_tools.c
@@ -21,7 +21,7 @@
 	struct timeval * result = malloc(sizeof(struct timeval));
 	char buf[50];
 	sub_time(time, start_time, result);
-	sprintf(buf, "%ld.%ld;", result->tv_sec, result->tv_usec);
+	sprintf(buf, "%ld.%ld;", result->tv_sec, (long)result->tv_usec);
 	fwrite(buf, strlen(buf), 1, file);
 }
 

--- End Message ---
--- Begin Message ---
Version: 3.2.1+dfsg-2+rm

Dear submitter,

as the package ion has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1024339

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: