From: "Михаил Бахтерев" <mob@k.imm.uran.ru>
To: Mark H Weaver <mhw@netris.org>
Cc: 32786@debbugs.gnu.org
Subject: bug#32786: (system* ...) call somehow interferes with atomic-box on armv7l
Date: Thu, 27 Sep 2018 11:18:16 +0500 [thread overview]
Message-ID: <20180927061816.GB9085@blacky> (raw)
In-Reply-To: <87sh1vcwws.fsf@netris.org>
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
>
>
next prev parent reply other threads:[~2018-09-27 6:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 17:13 bug#32786: (system* ...) call somehow interferes with atomic-box on armv7l Михаил Бахтерев
2018-09-21 21:26 ` Mark H Weaver
2018-09-22 4:39 ` Михаил Бахтерев
2018-09-22 4:50 ` Михаил Бахтерев
2018-09-27 5:49 ` Mark H Weaver
2018-09-27 6:18 ` Михаил Бахтерев [this message]
2018-10-05 19:43 ` Михаил Бахтерев
2018-10-05 23:22 ` Mark H Weaver
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180927061816.GB9085@blacky \
--to=mob@k.imm.uran.ru \
--cc=32786@debbugs.gnu.org \
--cc=mhw@netris.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).