From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 13 05:22:31 2015 Received: (at submit) by debbugs.gnu.org; 13 Nov 2015 10:22:31 +0000 Received: from localhost ([127.0.0.1]:36663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxBV1-0003YH-6a for submit@debbugs.gnu.org; Fri, 13 Nov 2015 05:22:31 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51355) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxBUg-0003Xq-36 for submit@debbugs.gnu.org; Fri, 13 Nov 2015 05:22:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxBUf-0004s5-5t for submit@debbugs.gnu.org; Fri, 13 Nov 2015 05:22:09 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxBUf-0004s1-32 for submit@debbugs.gnu.org; Fri, 13 Nov 2015 05:22:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxBUe-00033R-4I for bug-guile@gnu.org; Fri, 13 Nov 2015 05:22:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxBUd-0004re-CD for bug-guile@gnu.org; Fri, 13 Nov 2015 05:22:08 -0500 Received: from river6.fysh.org ([2001:41d0:d:20da::2]:33089 helo=river.fysh.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxBUd-0004rM-6D for bug-guile@gnu.org; Fri, 13 Nov 2015 05:22:07 -0500 Received: from zefram by river.fysh.org with local (Exim 4.80 #2 (Debian)) id 1ZxBUZ-0001H9-I5; Fri, 13 Nov 2015 10:22:03 +0000 Date: Fri, 13 Nov 2015 10:22:03 +0000 From: Zefram To: bug-guile@gnu.org Subject: bit shift wrong on maximal right shift Message-ID: <20151113102203.GL13455@fysh.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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: -4.0 (----) X-Debbugs-Envelope-To: submit 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.0 (----) With Guile 2.0.11: scheme@(guile-user)> (ash 123 (ash -1 63)) $1 = 123 Correct result would of course be zero. Problem only occurs for exactly this shift distance: one bit less produces the right answer. Problem also occurs on Guile 1.8.8. Looking at the implementation, the problem is attributable to the negation of the shift distance, which in twos-complement fails to produce the expected positive result. Note the resemblance to bug #14864, fixed in 2.0.10. This bug is of very similar form, but is distinct. The test cases of #14864 pass for me on the 2.0.11 that shows the problem with a 2^63 bit shift. My bug does occur with the rnrs bitwise-arithmetic-shift-right, which was used in #14864, as well as with ash. -zefram From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 20 12:03:01 2016 Received: (at 21901) by debbugs.gnu.org; 20 Jun 2016 16:03:01 +0000 Received: from localhost ([127.0.0.1]:47911 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bF1fA-00036F-SY for submit@debbugs.gnu.org; Mon, 20 Jun 2016 12:03:01 -0400 Received: from pb-sasl1.pobox.com ([64.147.108.66]:56768 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bF1f9-000368-J2 for 21901@debbugs.gnu.org; Mon, 20 Jun 2016 12:02:59 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 43F0A233B7; Mon, 20 Jun 2016 12:02:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=Cwny4lShYwDtbeEnNwtGpVdpp88=; b=DQNLQU lJg9DdYa2Hruz4ES2WBtG16uM254ZGDDdJywZOuILSCtAIHR/+bNHJYxGZAVnHUK wPKOaE2+PHDGN9eg2SUR+jkAk19DB4BZRbBVxWFJKPIDhGinUmfqivByYKA8Umu1 3ypHu5msRd9ej/5CowqIGh/bXQ2CDHFxT+iIo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=P3j3lAsR6Jc0vrb8STu+GMpuIGsFec50 +FfV3/3bENSICqL9mGOgYUBGDJsKUA2zDYxryfwBnHItG0Xgz4HR5+hOuEh62nEM FgUpPjBEzfORT5FaHLqS7sMDj6G0BIx9Ci4WlMiOL9kcOTHhQLXLe35R5IQDIh4/ HnmlubCmgiE= Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 3D001233B6; Mon, 20 Jun 2016 12:02:58 -0400 (EDT) Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 8A17B233B4; Mon, 20 Jun 2016 12:02:57 -0400 (EDT) From: Andy Wingo To: Zefram Subject: Re: bug#21901: bit shift wrong on maximal right shift References: <20151113102203.GL13455@fysh.org> Date: Mon, 20 Jun 2016 18:02:50 +0200 In-Reply-To: <20151113102203.GL13455@fysh.org> (zefram@fysh.org's message of "Fri, 13 Nov 2015 10:22:03 +0000") Message-ID: <87porbg85x.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 7498A1F0-3700-11E6-9E44-C1836462E9F6-02397024!pb-sasl1.pobox.com X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 21901 Cc: 21901@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.4 (-) On Fri 13 Nov 2015 11:22, Zefram writes: > With Guile 2.0.11: > > scheme@(guile-user)> (ash 123 (ash -1 63)) > $1 = 123 > > Correct result would of course be zero. Problem only occurs for > exactly this shift distance: one bit less produces the right answer. > Problem also occurs on Guile 1.8.8. Looking at the implementation, > the problem is attributable to the negation of the shift distance, > which in twos-complement fails to produce the expected positive result. > > Note the resemblance to bug #14864, fixed in 2.0.10. This bug is of > very similar form, but is distinct. The test cases of #14864 pass for > me on the 2.0.11 that shows the problem with a 2^63 bit shift. My bug > does occur with the rnrs bitwise-arithmetic-shift-right, which was used > in #14864, as well as with ash. Fascinating, thank you! Also occurs on 2.1.3. Andy From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 14 05:41:14 2018 Received: (at 21901-done) by debbugs.gnu.org; 14 Oct 2018 09:41:14 +0000 Received: from localhost ([127.0.0.1]:48813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBcte-0007Fd-LF for submit@debbugs.gnu.org; Sun, 14 Oct 2018 05:41:14 -0400 Received: from world.peace.net ([64.112.178.59]:42542) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBctc-0007FQ-Ie for 21901-done@debbugs.gnu.org; Sun, 14 Oct 2018 05:41:12 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gBctW-0002Wp-Ig; Sun, 14 Oct 2018 05:41:06 -0400 From: Mark H Weaver To: Zefram Subject: Re: bug#21901: bit shift wrong on maximal right shift References: <20151113102203.GL13455@fysh.org> Date: Sun, 14 Oct 2018 05:40:51 -0400 In-Reply-To: <20151113102203.GL13455@fysh.org> (Zefram's message of "Fri, 13 Nov 2015 10:22:03 +0000") Message-ID: <87pnwcuaqk.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21901-done Cc: 21901-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Zefram writes: > With Guile 2.0.11: > > scheme@(guile-user)> (ash 123 (ash -1 63)) > $1 = 123 > > Correct result would of course be zero. Problem only occurs for > exactly this shift distance: one bit less produces the right answer. Nice catch! It's finally fixed in commit 1990aa916382d0afcebd5315a6d6f555949ff654 on the stable-2.2 branch. The fix will be in Guile 2.2.5. Thanks for the report. Mark From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 20 18:27:27 2018 Received: (at 21901-done) by debbugs.gnu.org; 20 Oct 2018 22:27:27 +0000 Received: from localhost ([127.0.0.1]:33569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDziR-0001Y0-FQ for submit@debbugs.gnu.org; Sat, 20 Oct 2018 18:27:27 -0400 Received: from world.peace.net ([64.112.178.59]:35082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDziO-0001Xk-Vw for 21901-done@debbugs.gnu.org; Sat, 20 Oct 2018 18:27:25 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDziJ-0008Vq-C2; Sat, 20 Oct 2018 18:27:19 -0400 From: Mark H Weaver To: Zefram Subject: Re: bug#21901: bit shift wrong on maximal right shift References: <20151113102203.GL13455@fysh.org> Date: Sat, 20 Oct 2018 18:27:07 -0400 In-Reply-To: <20151113102203.GL13455@fysh.org> (Zefram's message of "Fri, 13 Nov 2015 10:22:03 +0000") Message-ID: <87sh102r0k.fsf@netris.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21901-done Cc: 21901-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) Zefram writes: > With Guile 2.0.11: > > scheme@(guile-user)> (ash 123 (ash -1 63)) > $1 = 123 Fixed in commit 1990aa916382d0afcebd5315a6d6f555949ff654 on the stable-2.2 branch. Closing this bug now. Thanks very much for finding this subtle bug. Mark From unknown Tue Jun 17 01:49:19 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Nov 2018 12: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