From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB_?= =?UTF-8?Q?=D0=91=D0=B0=D1=85=D1=82=D0=B5=D1=80=D0=B5=D0=B2?= Newsgroups: gmane.lisp.guile.bugs Subject: bug#32786: (system* ...) call somehow interferes with atomic-box on armv7l Date: Thu, 27 Sep 2018 11:18:16 +0500 Message-ID: <20180927061816.GB9085@blacky> References: <20180920171306.GA9185@k> <87fty2v8xo.fsf@netris.org> <20180922043938.GA4539@blacky> <87sh1vcwws.fsf@netris.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1538029026 23692 195.159.176.226 (27 Sep 2018 06:17:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Sep 2018 06:17:06 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 32786@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Sep 27 08:17:02 2018 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5Pbh-00062C-DZ for guile-bugs@m.gmane.org; Thu, 27 Sep 2018 08:17:01 +0200 Original-Received: from localhost ([::1]:33918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Pdo-00058Y-0s for guile-bugs@m.gmane.org; Thu, 27 Sep 2018 02:19:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5Pdj-00058S-Aq for bug-guile@gnu.org; Thu, 27 Sep 2018 02:19:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5Pdf-0001WD-Ct for bug-guile@gnu.org; Thu, 27 Sep 2018 02:19:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51593) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g5Pde-0001Uf-76 for bug-guile@gnu.org; Thu, 27 Sep 2018 02:19:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g5Pde-0000CP-1R for bug-guile@gnu.org; Thu, 27 Sep 2018 02:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB_?= =?UTF-8?Q?=D0=91=D0=B0=D1=85=D1=82=D0=B5=D1=80=D0=B5=D0=B2?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 27 Sep 2018 06:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32786 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 32786-submit@debbugs.gnu.org id=B32786.1538029102716 (code B ref 32786); Thu, 27 Sep 2018 06:19:01 +0000 Original-Received: (at 32786) by debbugs.gnu.org; 27 Sep 2018 06:18:22 +0000 Original-Received: from localhost ([127.0.0.1]:55851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5Pcz-0000BU-MW for submit@debbugs.gnu.org; Thu, 27 Sep 2018 02:18:21 -0400 Original-Received: from k.imm.uran.ru ([195.19.132.74]:48586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g5Pcy-0000BM-E3 for 32786@debbugs.gnu.org; Thu, 27 Sep 2018 02:18:21 -0400 Original-Received: from blacky (88.226-224-87.telenet.ru [87.224.226.88]) by k.imm.uran.ru (Postfix) with ESMTPSA id 1C57D19369; Thu, 27 Sep 2018 11:18:18 +0500 (+05) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=k.imm.uran.ru; s=kite; t=1538029098; bh=dNXqzu7iNnyIfV3Vp6Kyv19uFmJeMLNyQsJtXw1w2GM=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=nlQdruqVz70z2P7HtckF0OMHQh43wBOpjY2lIge7Cbjot62l/SuWkk5jo0wzwaGhT LX7omGpzvScrQH8K3m6HCAZzy7hKacChOJNfOt/SIvSuHcehZIf3GrHnbeorkY2FIz az3NIgMquH7VdN/0sUE3Zq69ZMUzGFgLKPAPSCV/oxgu+ba0d0baLBKErslHj+c395 UbnFTRzddrd5ts9qiJiWOZqvqeHcgwW6YkkKM4dYuqyYWkuEPsj7x4xyiooOyZWdm9 3x/CddOMB2p5S5rU+TLCwqwKTDVt9xDpyDb8glyQCX0Oef2zcCqPkeOXz0Q3Do2ROT NtmmGB9rjTV4XtVzKUD0dxdQKK4C3XAtkhAfACTP1OwlEB4R4jZNn7XPpN0f+wJwdm TJtkuRBky98qvYcgFewVxc/3ydaRET2rzvX1dfr/+aWQH7cjBXTsBwMHXxkeaxmD2s CFfZnOwhmF3XsAsnsAnj7QHLf/gc2PL6cqH3Yk5v7G5xZOdpwIiq90b172WNuKzIiL vLbWh6NmTJc+tN6uolVRO7GIxbB/YCTH27SCuWhl+VFKFYUX1NkywpVzFJdFcJ7kbc b1SJCJejyddAcm21IVUU4aaHqwEc1jGWn1WAtwMYFgZE6xsuIIMa+As8gWex82n7ec HIwTW5TqZiGYBdM9V5Rc1rG4= Content-Disposition: inline In-Reply-To: <87sh1vcwws.fsf@netris.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9174 Archived-At: Thanks for clarification! I'll be able to test the patch in a couple of days. - MB. Respectfully On Thu, Sep 27, 2018 at 01:49:23AM -0400, Mark H Weaver wrote: > Hi, > > Thanks for the additional details. I was able to reproduce the bug, and > I believe I now see the problem. > > 'atomic-box-compare-and-swap!' is implemented using > 'atomic_compare_exchange_weak' (if available), but neglects to handle > the case where 'atomic_compare_exchange_weak' may spuriously fail. In > that case, the box is left unchanged, although the observed value was > equal to the expected value. > > What's happening here is that the 'atomic-box-compare-and-swap!' in > 'sleep-loop' fails spuriously, leaving the box in state #:accepted > although it returns #:accepted as its result. When the main loop > discovers this, it changes the state to #:need-to-sleep, although the > thread has already ended. > > To confirm this hypothesis, I added a print statement to the main loop > showing the state of the box that it observed during the protocol > exchange, and indeed it sees #:accepted the first time it checks, and > #:need-to-sleep in all later iterations. > > I've attached a proposed patch that I hope will fix this problem. If > you'd be willing to test it, I'd be grateful, but otherwise I'll try to > test it in the next week or so. My access to armv7l boxes is somewhat > limited. > > Thanks for this report. > > Mark > >