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: Fri, 12 Jul 2019 09:02:22 +0000 Message-ID: References: <87muhks3b5.fsf@hochschule-trier.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000004bed0f058d782d6c" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="159516"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 36609@debbugs.gnu.org To: Andreas Politz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 12 11:04: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 1hlrTL-000fNW-NL for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2019 11:04:07 +0200 Original-Received: from localhost ([::1]:47652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlrTK-0002U2-Kd for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2019 05:04:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36452) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlrTH-0002Ts-96 for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 05:04:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlrTG-0007M4-6I for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 05:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlrTG-0007Lt-0n for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 05:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlrTF-0006BX-PN for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2019 05:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2019 09:04:01 +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.156292218623710 (code B ref 36609); Fri, 12 Jul 2019 09:04:01 +0000 Original-Received: (at 36609) by debbugs.gnu.org; 12 Jul 2019 09:03:06 +0000 Original-Received: from localhost ([127.0.0.1]:39262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlrSL-0006AM-Tr for submit@debbugs.gnu.org; Fri, 12 Jul 2019 05:03:06 -0400 Original-Received: from mail-ot1-f45.google.com ([209.85.210.45]:41116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hlrSK-00069q-Ow for 36609@debbugs.gnu.org; Fri, 12 Jul 2019 05:03:05 -0400 Original-Received: by mail-ot1-f45.google.com with SMTP id o101so8756205ota.8 for <36609@debbugs.gnu.org>; Fri, 12 Jul 2019 02:03:04 -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=zHNRHJZaWTM5dTYtOB/B5Za/6ari5HWZ1jXI1ST8Yjw=; b=pCWJnDp/bLStE+HqQE3vLbgo54LG3Fax/vfmD2jBtGlVt+vyb8gbHNeTTg9i02fMI1 kX+HizPuW3jPTmnuLh2Z7AUMt/PdL3+9H6oUiDKJVlRB6XRu6wJ0XEQYvchGoxYdySmi mqr+wq2+i6qyd9OocSQv62vj9vg+j0DjBQgB30rF41Tj3q9YJSTv3OMLdDUwcFZbf8PD ja6OK3OfRqotfc528Zpn6asQxLlh/7/Ww30t2fk+DftyqFCRcsl+kJSI/wZQ/woIcFCp 4/TD/0hymryAnpTL9amfrrSux5nL4Oo0OloSnu7ApulkQ7d3H+SlfR+sVRKrAZmRetcX ubqA== 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=zHNRHJZaWTM5dTYtOB/B5Za/6ari5HWZ1jXI1ST8Yjw=; b=NVELFlAWlsy9H0o2GjBVKEA474yMHersLU/R0enbz9HAR7bBFiqTL1SDb4FxiGoF+d 4MPfjS7M4pZd2+RwIqzkisrgR/hxguO9m14XOta3oZ7GxRC+IW89I0uyLf24gbheKVIc MHQqRogymQiN/DBlJ3CFLQf6h78+g/Kz3F9Y8LA5gRn+0lV0z52iSC3JZcr90dW3SvC/ 4p/EX8PwQOTekoOFDCe7LNLH4jD3cVnhuBxPdJk6FUVM/ib+p3YjmvFMYWynv9Gqq+AU t4dw8QGS2E0p7rJ0bUeYVVmQznt4LFQq9h65FOVbq8pjwFh2x1PwbDCupKMlWimxKdiG 6k6Q== X-Gm-Message-State: APjAAAUCj336JHxdkVZgJTxT/znCi2BkSOiiXHxwWezIqsjl5nCTESiq gZY1iZGiZcsNg415xhh95mxS3WfPBacb4kD3kZQ= X-Google-Smtp-Source: APXvYqwzbQ1xMNFHmIESl33pt2Lh3LFxcxHMkHdU195gFNfW5yUwK6G5mlCGpczahJ11ZC5otLWzof2Hy54tP5/qmrY= X-Received: by 2002:a9d:6014:: with SMTP id h20mr7548994otj.210.1562922179063; Fri, 12 Jul 2019 02:02:59 -0700 (PDT) In-Reply-To: <87muhks3b5.fsf@hochschule-trier.de> 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:162759 Archived-At: --0000000000004bed0f058d782d6c Content-Type: text/plain; charset="UTF-8" On Thu, Jul 11, 2019 at 8:52 PM Andreas Politz wrote: > I think there is a race-condition in the implementation of threads. I > tried to find a minimal test-case, without success. Thus, I've attached > a lengthy source-file. Loading that file should trigger this bug and > may freeze your session. It does here, so I can provide further debugging information if needed. On first glance, it appears that xgselect returns abnormally with g_main_context acquired in one thread, and then other threads fail to acquire it and loop endlessly. Can you confirm that this very dirty patch avoids (it's not a fix by any means!) the problem? --0000000000004bed0f058d782d6c Content-Type: text/x-patch; charset="US-ASCII"; name="Avoid-glib-issue.patch" Content-Disposition: attachment; filename="Avoid-glib-issue.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jxzvh69j0 ZGlmZiAtLWdpdCBhL3NyYy94Z3NlbGVjdC5jIGIvc3JjL3hnc2VsZWN0LmMKaW5kZXggOTk4MmEx ZjBlOS4uOWZmZWI2YzY2YyAxMDA2NDQKLS0tIGEvc3JjL3hnc2VsZWN0LmMKKysrIGIvc3JjL3hn c2VsZWN0LmMKQEAgLTU4LDggKzU4LDE2IEBAIHhnX3NlbGVjdCAoaW50IGZkc19saW0sIGZkX3Nl dCAqcmZkcywgZmRfc2V0ICp3ZmRzLCBmZF9zZXQgKmVmZHMsCiAgIGludCBpLCBuZmRzLCB0bW9f aW5fbWlsbGlzZWMsIG11c3RfZnJlZSA9IDA7CiAgIGJvb2wgbmVlZF90b19kaXNwYXRjaDsKIAor ICBwdHJ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