From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#36609: 27.0.50; Possible race-condition in threading implementation Date: Sat, 13 Jul 2019 15:57:17 +0000 Message-ID: References: <87muhks3b5.fsf@hochschule-trier.de> <83muhj2zmb.fsf@gnu.org> <83ims72xcj.fsf@gnu.org> <83a7dj2sz9.fsf@gnu.org> <835zo72jmr.fsf@gnu.org> <834l3r2jbe.fsf@gnu.org> <8336jb2fhq.fsf@gnu.org> <83wogmyo1k.fsf@gnu.org> <83sgraylof.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="148834"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36609@debbugs.gnu.org, politza@hochschule-trier.de To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 13 17:58:08 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmKPX-000caH-0V for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 17:58:07 +0200 Original-Received: from localhost ([::1]:56976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmKPW-000689-0k for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jul 2019 11:58:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41702) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmKPT-000680-K2 for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:58:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmKPS-0001Od-Ma for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:58:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34408) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmKPS-0001OZ-J0 for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmKPS-0005Eo-Ft for bug-gnu-emacs@gnu.org; Sat, 13 Jul 2019 11:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jul 2019 15:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36609 X-GNU-PR-Package: emacs Original-Received: via spool by 36609-submit@debbugs.gnu.org id=B36609.156303348120132 (code B ref 36609); Sat, 13 Jul 2019 15:58:02 +0000 Original-Received: (at 36609) by debbugs.gnu.org; 13 Jul 2019 15:58:01 +0000 Original-Received: from localhost ([127.0.0.1]:43229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmKPR-0005EZ-AB for submit@debbugs.gnu.org; Sat, 13 Jul 2019 11:58:01 -0400 Original-Received: from mail-ot1-f54.google.com ([209.85.210.54]:46479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmKPP-0005EK-Kr for 36609@debbugs.gnu.org; Sat, 13 Jul 2019 11:58:00 -0400 Original-Received: by mail-ot1-f54.google.com with SMTP id z23so12465499ote.13 for <36609@debbugs.gnu.org>; Sat, 13 Jul 2019 08:57:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gx2dwGDHTSKy1W7N9Zf+G+Rm++uSMVXOmjVEVpjKRbU=; b=F9xdfU6Wz+RVxMM2o6DEc64ARH94mh66tKRihBNPLo8grJa6INVNU11PHR8yF1fRMd 3edPTtBv/OuYlQxbfBYfwKwjOg421JCL7QQyzlkXSqhb/B9tjTdwHZ4lTuYtZddNqG+A sAAG7RDiTQGzETdjpYg/1hmWeo2rp7A9VWX+IOBvZgb3b1kUoPWmnh4aRQuq9YsNLJJ7 aXAWdcpyM5cM+LQdx4wz8w3B26J72RGhfyuNm+D4iyK3Q5Jt3hv8oAfcMR+XZaMQQV9O UJidxYkTeLFLtVti/v301vYm3rF3hrfEXp27Y/gjH1rDi+CuIH3Gb1k8dmqD1ti4+msr hLXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gx2dwGDHTSKy1W7N9Zf+G+Rm++uSMVXOmjVEVpjKRbU=; b=mTmrg1iEsWx6YruRO7/iX6OKGjfssQrNdWP/s2uu6OEEKMTi0PK/iXW1VnUDJwvL6Q HNO77itg1wlBDlrGOEo9o2vOC38RC9/IACw3xpDrAAAYKYRgEWferxfQCICCNZtAWaMN XelQHf+XehTej35sIJxW8yWcL6q9H0a9pBBpmxnmq5icRI7lSngExUTEVQ4N9CJIbB6E m1rFTNjb7FlZzoFzTfyNULwTzL3jnku3RIJsxspH2dvJHElp+zcy9+3eOXLDIdYIo8Sx 25vjkeh75ibvrvtzrmL7EYzNSEk/NjU9HbdBX1rGs4tDBuoobpQ3LkBnKIsCpA6W3doo VyvA== X-Gm-Message-State: APjAAAUAovj0JND+DoXqvR4a/F3u+fMdJH24wmjy4mco1Ry4h6L4jSEu bYFdREOHxg/zJcF3sH1ySFSkVLQOuBkiDHcF3/Q= X-Google-Smtp-Source: APXvYqwEzJUmkMpyLWKE3r4qn67hr+QfRe8W2Hc0i8dZDwKN4UxV0pd3bpP44gISge+y0OqevRjwmWvYC7BT0Ev8nuY= X-Received: by 2002:a9d:664c:: with SMTP id q12mr8278598otm.175.1563033473979; Sat, 13 Jul 2019 08:57:53 -0700 (PDT) In-Reply-To: <83sgraylof.fsf@gnu.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: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:162917 Archived-At: On Sat, Jul 13, 2019 at 3:54 PM Eli Zaretskii wrote: > > But I still would like to understand why we need to maintain a flag > > per thread. We don't. I had originally planned to make reacquiring the lock fail gracefully if we can't spin-lock, but that didn't make it into the patch, so it should be simplified as you suggest. > Specifically, why not make this flag thread-independent, and have any > thread release the context lock if that variable is non-zero? I don't > think it matters which thread locked the Glib context, we just need to > release it once we emerge from thread_select, and do it before we > might call Fsignal. That the lock might be released by a thread other > than the one which locked it shouldn't matter, I think, as long as we > consider all the Lisp threads acting together on behalf of Emacs. I agree entirely.