From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#26253: Coreutils 8.26 test failure on arm-linux-gnueabihf Date: Sat, 25 Mar 2017 23:08:31 +0100 Message-ID: <87r31lt3fk.fsf@gnu.org> References: <87a889weaq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crtrt-0003tz-5R for bug-guix@gnu.org; Sat, 25 Mar 2017 18:09:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crtrq-0003YB-0E for bug-guix@gnu.org; Sat, 25 Mar 2017 18:09:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1crtrp-0003Y1-Sy for bug-guix@gnu.org; Sat, 25 Mar 2017 18:09:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1crtrp-0003sF-NE for bug-guix@gnu.org; Sat, 25 Mar 2017 18:09:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87a889weaq.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 25 Mar 2017 16:45:33 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 26253@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > So the two lines that fail are these: > > # Explicitly disallow values above CUT_MAX > (ulimit -v $vm && returns_ 1 cut -b$SIZE_MAX /dev/null 2>/dev/null) || fa= il=3D1 > (ulimit -v $vm && returns_ 1 cut -b$SIZE_OFLOW /dev/null 2>/dev/null) || = fail=3D1 > > I don=E2=80=99t understand why at this point, but I found that removing > =E2=80=9C2>/dev/null=E2=80=9D from these two lines lets the test pass (an= d AIUI, this > redirection is not necessary for the test; it just hides the > > cut: byte/character offset '4294967296' is too large >=20=20=20 > error message.) With the attached file I (and a patch coreutils such that it would build; #:tests? #f is enough), I was able to reproduce the problem. The build log I get is this: --8<---------------cut here---------------start------------->8--- + ulimit -v 2004 + echo before before + /gnu/store/iglljv347sj1mjx8r6li7plb4h7cv8h9-coreutils-8.26/bin/cut -b4294= 967296 /dev/null /gnu/store/9bkl74hd3f1gysdkq22hp8w4z9w8022l-bash-4.4.12/bin/sh: xmalloc: va= riables.c:4539: cannot allocate 69 bytes (57344 bytes allocated) + echo after 2 after 2 /gnu/store/iglljv347sj1mjx8r6li7plb4h7cv8h9-coreutils-8.26/bin/cut: byte/ch= aracter offset '4294967296' is too large Try '/gnu/store/iglljv347sj1mjx8r6li7plb4h7cv8h9-coreutils-8.26/bin/cut --h= elp' for more information. /gnu/store/iglljv347sj1mjx8r6li7plb4h7cv8h9-coreutils-8.26/bin/cut: byte/ch= aracter offset '4294967296' is too large Try '/gnu/store/iglljv347sj1mjx8r6li7plb4h7cv8h9-coreutils-8.26/bin/cut --h= elp' for more information. ;;; (bash "/gnu/store/9bkl74hd3f1gysdkq22hp8w4z9w8022l-bash-4.4.12/bin/sh") ;;; (status 0 0) ;;; (status2 256 1) ;;; (status3 256 1) --8<---------------cut here---------------end--------------->8--- The thing that=E2=80=99s failing here is the shell that invokes =E2=80=98cu= t=E2=80=99, and thus we get an exit value of 2 whereas the test explicitly checks for 1. This is very sensitive: depending on the command sequence we pass to =E2=80= =9Csh -c=E2=80=9D, we hit that problem or we don=E2=80=99t. The fact that removi= ng =E2=80=9C2>/dev/null=E2=80=9D solved the problem was probably just chance. So I think Coreutils commit 28803c8a3144d5d4363cdbd148bbe067af1a67c2, which arbitrarily increased the value passed to =E2=80=9Culimit -v=E2=80=9D= , goes in the right direction after all but is insufficient. I=E2=80=99m trying out a new patch based on that and will push if it works. Ludo=E2=80=99. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=test-coreutils.scm Content-Description: the test (use-modules (guix)) (define cu (@@ (gnu packages commencement) coreutils-final)) (define bash (@@ (gnu packages commencement) bash-final)) (define build #~(let* ((_ #$output) (cut (string-append #$cu "/bin/cut -b4294967296 /dev/null ")) (status (system* (pk 'bash (string-append #$bash "/bin/sh")) "-c" (string-append "set -x; (ulimit -v 2004; echo before; " cut " 2>/dev/null)" "; echo after $?"))) (status2 (system cut)) (status3 (apply system* (string-tokenize cut)))) (pk 'status status (status:exit-val status)) (pk 'status2 status2 (status:exit-val status2)) (pk 'status3 status3 (status:exit-val status3)) #f)) (with-store store (run-with-store store (mlet %store-monad ((drv (gexp->derivation "foo" build))) (built-derivations (list drv))))) --=-=-=--