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

Bug#895103: why3 server broken on multiple architectures



Package: why3
Version: 0.88.3-1
Severity: grave
Tags: patch
Justification: renders package unusable
User: ubuntu-devel@lists.ubuntu.com
Usertags: origin-ubuntu bionic ubuntu-patch autopkgtest

Dear Ralf,

The 0.88.3 version of why3 has been blocked for a while from being included
in the upcoming Ubuntu 18.04 release due to failing autopkgtests on multiple
architectures, e.g.:

autopkgtest [08:58:21]: test why3+alt-ergo: [-----------------------
client_connect: connection failed: Connection refused (connect,) (socket_name=/tmp/why3server3f8c61sock)
autopkgtest [08:58:57]: test why3+alt-ergo: -----------------------]
why3+alt-ergo        FAIL non-zero exit status 1

  https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-bionic/bionic/arm64/w/why3/20180405_094212_aa650@/log.gz

I finally had a chance to track this down, and it turns out why3 0.88.3 is
completely broken upstream on various architectures (arm64, armhf, ppc64el,
and s390x, at least) due to wrong handling of return values from
getopt_long() that prevents why3-server from ever starting.

This issue was not seen in Debian's automated test runs because Debian only
runs autopkgtests for amd64: https://ci.debian.net/packages/w/why3/ but in
any case this would not have prevented the why3 package from being broken in
Debian testing because Debian unfortunately does not gate testing on
autopkgtest failures.

The attached patch fixes the trivial portability issue in why3, and as seen
at http://autopkgtest.ubuntu.com/packages/w/why3 the tests are now passing
for 0.88.3 on all architectures where they previously passed.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org
diff -Nru why3-0.88.3/debian/patches/portable-getopt.patch why3-0.88.3/debian/patches/portable-getopt.patch
--- why3-0.88.3/debian/patches/portable-getopt.patch	1969-12-31 16:00:00.000000000 -0800
+++ why3-0.88.3/debian/patches/portable-getopt.patch	2018-04-06 17:22:54.000000000 -0700
@@ -0,0 +1,19 @@
+Description: fix unportable assumptions in getopt_long() handling
+ Don't store an int in a char and expect comparison to -1 to work across
+ architectures.
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Last-Modified: 2018-04-06
+
+Index: why3-0.88.3/src/server/options.c
+===================================================================
+--- why3-0.88.3.orig/src/server/options.c
++++ why3-0.88.3/src/server/options.c
+@@ -30,7 +30,7 @@ void parse_options(int argc, char **argv
+   };
+   while (1) {
+      int option_index = 0;
+-     char c = 0;
++     int c = 0;
+      c = getopt_long (argc, argv, "j:s:",
+                       long_options, &option_index);
+      /* Detect the end of the options. */
diff -Nru why3-0.88.3/debian/patches/series why3-0.88.3/debian/patches/series
--- why3-0.88.3/debian/patches/series	2018-01-14 14:46:38.000000000 -0800
+++ why3-0.88.3/debian/patches/series	2018-04-06 17:20:54.000000000 -0700
@@ -0,0 +1 @@
+portable-getopt.patch

Reply to: