Source: libarchive Version: 3.0.4-1 Severity: important User: debian-...@lists.debian.org Usertags: ftbfs-gcc-4.7
Hello, libarchive currently FTBFS on hurd-i386, see https://buildd.debian.org/status/fetch.php?pkg=libarchive&arch=hurd-i386&ver=3.0.4-1%2Bb1&stamp=1336821322 This build was done with gcc-4.7, which is probably the "culprit", by optimizing yet more. The issue is with the following piece of code: min_time = archive_entry_mtime(ae); assert(min_time <= 0); /* Simply asserting min_time - 1 > 0 breaks with some compiler optimizations. */ t = min_time - 1; assert(t > 0); This is supposed to check for overflowing when subtracting 1 from the minimum time_t value. Problem is: that is undefined in C, and the compiler is thus allowed to do anything, including always raising the assertion, since we have already checked that the integer is negative, so subtracting 1 to it is not supposed to make it positive (again, overflow is undefined). Printing t, for instance, fixes the test, since the compiler then actually computes t, but without it the assert always gets triggered. I tried to reproduce it with i386, without success, but anyway, the piece of code really has undefined behavior. Samuel -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.0.4 (SMP w/8 CPU cores) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash -- Samuel Thibault <samuel.thiba...@fnac.net> <O> Ça peut être une madeleine à sous munitions (avec des composants, par exemple) -+- #runtime -+- -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org