From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 07:56:23 2014 Received: (at submit) by debbugs.gnu.org; 18 Jun 2014 11:56:23 +0000 Received: from localhost ([127.0.0.1]:51204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxETS-0007PT-GJ for submit@debbugs.gnu.org; Wed, 18 Jun 2014 07:56:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34708) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxCah-00038v-FF for submit@debbugs.gnu.org; Wed, 18 Jun 2014 05:55:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxCaS-0001dk-80 for submit@debbugs.gnu.org; Wed, 18 Jun 2014 05:55:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RCVD_NUMERIC_HELO, T_FSL_HELO_BARE_IP_2 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxCaS-0001dg-5S for submit@debbugs.gnu.org; Wed, 18 Jun 2014 05:55:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxCaK-00024O-FY for bug-coreutils@gnu.org; Wed, 18 Jun 2014 05:55:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxCaD-0001cD-0c for bug-coreutils@gnu.org; Wed, 18 Jun 2014 05:55:16 -0400 Received: from plane.gmane.org ([80.91.229.3]:35231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxCaC-0001af-Qb for bug-coreutils@gnu.org; Wed, 18 Jun 2014 05:55:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WxCa7-0007ni-Fo for bug-coreutils@gnu.org; Wed, 18 Jun 2014 11:55:03 +0200 Received: from 130.225.20.51 ([130.225.20.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jun 2014 11:55:03 +0200 Received: from rv by 130.225.20.51 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jun 2014 11:55:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-coreutils@gnu.org From: Rasmus Villemoes Subject: seq weirdness with -0 Date: Wed, 18 Jun 2014 11:41:43 +0200 Organization: D03 Lines: 19 Message-ID: <87a99av9k8.fsf@rasmusvillemoes.dk> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 130.225.20.51 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:Q8Z0Dt2xZ1CeHKeF1r0Z1Syqf/w= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 18 Jun 2014 07:56:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) $ ./seq --version | head -1 seq (GNU coreutils) 8.22.119-8a51b ./seq -0 n works fine when n is a single digit: $ ./seq --separator=, -0 5 -0,1,2,3,4,5 But something weird happens when one uses a number >= 10: $ ./seq --separator=, -0 10 -0,-1,-2,-3,-4,-5,-6,-7,-8,-9,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,/0,/1,/2,/3,/4,/5,/6,/7,/8,/9,00,01,02,03,04,05,06,07,08,09,10 [It also happens without the --separator; I just use that to save vertical space.] This smells of ASCII, and looking at the code, the problem is very likely to be the seq_fast/incr functions. I don't know what the simplest fix is, though. Rasmus From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 08:03:57 2014 Received: (at 17800) by debbugs.gnu.org; 18 Jun 2014 12:03:57 +0000 Received: from localhost ([127.0.0.1]:51213 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxEam-0007cw-II for submit@debbugs.gnu.org; Wed, 18 Jun 2014 08:03:57 -0400 Received: from mail4.vodafone.ie ([213.233.128.170]:54202) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxEaf-0007cX-AV for 17800@debbugs.gnu.org; Wed, 18 Jun 2014 08:03:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApQBANJ+oVNtT4V1/2dsb2JhbAANTcRtgxQBgSGEeAEBAQQyAUYQCw0BCgkWDwkDAgECAUUGDQEHAQGIQ6wSoAMXjnUHhEMBA6Fmj3g Received: from unknown (HELO [192.168.1.79]) ([109.79.133.117]) by mail3.vodafone.ie with ESMTP; 18 Jun 2014 13:03:37 +0100 Message-ID: <53A18019.4030802@draigBrady.com> Date: Wed, 18 Jun 2014 13:03:37 +0100 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Rasmus Villemoes Subject: Re: bug#17800: seq weirdness with -0 References: <87a99av9k8.fsf@rasmusvillemoes.dk> In-Reply-To: <87a99av9k8.fsf@rasmusvillemoes.dk> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17800 Cc: 17800@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 06/18/2014 10:41 AM, Rasmus Villemoes wrote: > $ ./seq --version | head -1 > seq (GNU coreutils) 8.22.119-8a51b > > ./seq -0 n works fine when n is a single digit: > > $ ./seq --separator=, -0 5 > -0,1,2,3,4,5 > > But something weird happens when one uses a number >= 10: > > $ ./seq --separator=, -0 10 > -0,-1,-2,-3,-4,-5,-6,-7,-8,-9,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,/0,/1,/2,/3,/4,/5,/6,/7,/8,/9,00,01,02,03,04,05,06,07,08,09,10 > > [It also happens without the --separator; I just use that to save > vertical space.] This smells of ASCII, and looking at the code, the > problem is very likely to be the seq_fast/incr functions. I don't know > what the simplest fix is, though. Ouch. I see the issue. Fix on the way... thanks! Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 09:39:22 2014 Received: (at 17800-done) by debbugs.gnu.org; 18 Jun 2014 13:39:23 +0000 Received: from localhost ([127.0.0.1]:51273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxG59-0002lo-2V for submit@debbugs.gnu.org; Wed, 18 Jun 2014 09:39:22 -0400 Received: from mail6.vodafone.ie ([213.233.128.184]:57490) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxG51-0002lQ-U6 for 17800-done@debbugs.gnu.org; Wed, 18 Jun 2014 09:39:15 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEDAFmVoVNtT4V1/2dsb2JhbAANTYNfU8NOAYEghHgBAQEEeRALDQEDAwECAQkWDwkDAgECAT0IBg0BBQIBARaILQOsQJ97F45kEQcJhDoEkgCBQIhGhWCGOIlA Received: from unknown (HELO [192.168.1.79]) ([109.79.133.117]) by mail3.vodafone.ie with ESMTP; 18 Jun 2014 14:39:04 +0100 Message-ID: <53A19677.1080307@draigBrady.com> Date: Wed, 18 Jun 2014 14:39:03 +0100 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Rasmus Villemoes Subject: Re: bug#17800: seq weirdness with -0 References: <87a99av9k8.fsf@rasmusvillemoes.dk> <53A18019.4030802@draigBrady.com> In-Reply-To: <53A18019.4030802@draigBrady.com> X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------000006010203090002030800" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17800-done Cc: 17800-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) This is a multi-part message in MIME format. --------------000006010203090002030800 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 06/18/2014 01:03 PM, Pádraig Brady wrote: > On 06/18/2014 10:41 AM, Rasmus Villemoes wrote: >> $ ./seq --version | head -1 >> seq (GNU coreutils) 8.22.119-8a51b >> >> ./seq -0 n works fine when n is a single digit: >> >> $ ./seq --separator=, -0 5 >> -0,1,2,3,4,5 >> >> But something weird happens when one uses a number >= 10: >> >> $ ./seq --separator=, -0 10 >> -0,-1,-2,-3,-4,-5,-6,-7,-8,-9,.0,.1,.2,.3,.4,.5,.6,.7,.8,.9,/0,/1,/2,/3,/4,/5,/6,/7,/8,/9,00,01,02,03,04,05,06,07,08,09,10 >> >> [It also happens without the --separator; I just use that to save >> vertical space.] This smells of ASCII, and looking at the code, the >> problem is very likely to be the seq_fast/incr functions. I don't know >> what the simplest fix is, though. > > Ouch. I see the issue. Fix on the way... Fast path avoidance logic updated in the attached. thanks! Pádraig. --------------000006010203090002030800 Content-Type: text/x-patch; name="seq-0.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="seq-0.patch" >From a0027968594781b5421abe0ec9636d6653d2cc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 18 Jun 2014 14:30:57 +0100 Subject: [PATCH] seq: fix incorrect output with start or end of -0 * src/seq.c (main): Avoid seq_fast() with a start or end of -0. * tests/misc/seq.pl: Add test cases. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/17800 --- NEWS | 3 +++ src/seq.c | 2 +- tests/misc/seq.pl | 3 +++ 3 files changed, 7 insertions(+), 1 deletions(-) diff --git a/NEWS b/NEWS index 5d1fe99..77286f8 100644 --- a/NEWS +++ b/NEWS @@ -74,6 +74,9 @@ GNU coreutils NEWS -*- outline -*- ptx now consistently trims whitespace when processing multiple files. [This bug was present in "the beginning".] + seq again generates correct output with start or end values = -0. + [bug introduced in coreutils-8.20.] + shuf --repeat no longer dumps core if the input is empty. [bug introduced with the --repeat feature in coreutils-8.22] diff --git a/src/seq.c b/src/seq.c index 8fced4a..1124358 100644 --- a/src/seq.c +++ b/src/seq.c @@ -604,7 +604,7 @@ main (int argc, char **argv) if (asprintf (&s2, "%0.Lf", last.value) < 0) xalloc_die (); - if (seq_fast (s1, s2)) + if (*s1 != '-' && *s2 != '-' && seq_fast (s1, s2)) { IF_LINT (free (s1)); IF_LINT (free (s2)); diff --git a/tests/misc/seq.pl b/tests/misc/seq.pl index 329e1df..9248436 100755 --- a/tests/misc/seq.pl +++ b/tests/misc/seq.pl @@ -143,6 +143,9 @@ my @Tests = ['not-fast-1', qw(1 3 1), {OUT => [qw(1)]}], ['not-fast-2', qw(1 1 4.2), {OUT => [qw(1 2 3 4)]}], ['not-fast-3', qw(1 1 0)], + # In 8.20..8.22 a start or end of -0 was broken + ['not-fast-4', qw(-0 10), {OUT => [qw(-0 1 2 3 4 5 6 7 8 9 10)]}], + ['not-fast-5', qw(1 -0)], # Ensure the correct parameters are passed to the fast path ['fast-1', qw(4), {OUT => [qw(1 2 3 4)]}], -- 1.7.7.6 --------------000006010203090002030800-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 11:47:45 2014 Received: (at 17800) by debbugs.gnu.org; 18 Jun 2014 15:47:45 +0000 Received: from localhost ([127.0.0.1]:51941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxI5R-0006Hv-6z for submit@debbugs.gnu.org; Wed, 18 Jun 2014 11:47:45 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:64484) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxI5P-0006Hh-Bh for 17800@debbugs.gnu.org; Wed, 18 Jun 2014 11:47:44 -0400 Received: from [10.0.4.15] (gw.camline.com [62.153.148.194]) by mrelayeu.kundenserver.de (node=mreue003) with ESMTP (Nemesis) id 0LtBwl-1WZHA41Kdn-012sFI; Wed, 18 Jun 2014 17:47:35 +0200 Message-ID: <53A1B496.8000109@bernhard-voelker.de> Date: Wed, 18 Jun 2014 17:47:34 +0200 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: 17800@debbugs.gnu.org, P@draigBrady.com, rv@rasmusvillemoes.dk Subject: Re: bug#17800: seq weirdness with -0 References: <87a99av9k8.fsf@rasmusvillemoes.dk> <53A18019.4030802@draigBrady.com> <53A19677.1080307@draigBrady.com> In-Reply-To: <53A19677.1080307@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:6hLmM+3iZBYaWPH6KhhfjarHknWI0m1YuDuRe8j19QP gy3/ntChLqbpQ3rU98JQjwLr3qHcuTnIuHvCzAVGQUkBlmMb1s nlwz7bA/uJWtsMKISgQhSFpX1r2esiqyOJNtzOwq+bjdBwi9z9 kP9UtR0lhU/vVasgdKclOrRia7fsE58Alkq94G1D8hm+hwTpjw Zy37zSxpOSh5R/ZGHo8JhNm9kvyQYYVNKSy0WO2P7u8t3HTX0+ dNemwpY1xGvIu+4LO0fWwJsfADfmCrmNomYAZHos0tCtRXprJH uv+udRifKQAPt3XgweBrEnqIgVACWJGYmUJwyE9Iv2oFI0PYtZ 65buBQhmyoSdkC3ViY/v0O4Yq+I7cvhtBQMJ9RsKx X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17800 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 06/18/2014 03:39 PM, Pádraig Brady wrote: > Subject: [PATCH] seq: fix incorrect output with start or end of -0 LGTM - although I'm still wondering what's the use case behind a negative Null "-0". ;-) Thanks & have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 18 15:11:36 2014 Received: (at submit) by debbugs.gnu.org; 18 Jun 2014 19:11:36 +0000 Received: from localhost ([127.0.0.1]:52125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxLGi-0003KP-7E for submit@debbugs.gnu.org; Wed, 18 Jun 2014 15:11:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56266) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WxLGf-0003KB-No for submit@debbugs.gnu.org; Wed, 18 Jun 2014 15:11:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxLGT-0003AQ-Cg for submit@debbugs.gnu.org; Wed, 18 Jun 2014 15:11:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,RCVD_NUMERIC_HELO, T_FSL_HELO_BARE_IP_2 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:55730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxLGT-0003AK-9B for submit@debbugs.gnu.org; Wed, 18 Jun 2014 15:11:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxLGM-0002HL-W1 for bug-coreutils@gnu.org; Wed, 18 Jun 2014 15:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxLGG-00037N-Ok for bug-coreutils@gnu.org; Wed, 18 Jun 2014 15:11:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:42743) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxLGG-00037B-Hz for bug-coreutils@gnu.org; Wed, 18 Jun 2014 15:11:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WxLGD-0002HI-97 for bug-coreutils@gnu.org; Wed, 18 Jun 2014 21:11:05 +0200 Received: from 130.225.20.51 ([130.225.20.51]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jun 2014 21:11:05 +0200 Received: from rv by 130.225.20.51 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Jun 2014 21:11:05 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: bug-coreutils@gnu.org From: Rasmus Villemoes Subject: Re: bug#17800: seq weirdness with -0 Date: Wed, 18 Jun 2014 21:10:50 +0200 Organization: D03 Lines: 18 Message-ID: <8738f2t4n9.fsf@rasmusvillemoes.dk> References: <87a99av9k8.fsf@rasmusvillemoes.dk> <53A18019.4030802@draigBrady.com> <53A19677.1080307@draigBrady.com> <53A1B496.8000109@bernhard-voelker.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 130.225.20.51 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:9cwcRhIdGsW81Kz+sgzwiiCkxD8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: submit Cc: Bernhard Voelker , P@draigBrady.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) Bernhard Voelker writes: > On 06/18/2014 03:39 PM, Pádraig Brady wrote: >> Subject: [PATCH] seq: fix incorrect output with start or end of -0 > > LGTM - although I'm still wondering what's the use case > behind a negative Null "-0". ;-) I agree it is unlikely anyone would write -0 explicitly, but one could imagine a script doing seq -$n $m | ... where the preceding code sets $n and $m to be some non-negative integers. Thanks for the quick response. Rasmus From unknown Sun Aug 17 01:49:00 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 17 Jul 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator