From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25247: 26.0.50; Concurrency crashes Date: Fri, 23 Dec 2016 12:04:29 +0200 Message-ID: <83shpfyn9u.fsf@gnu.org> References: <87bmw4w9i2.fsf@gmail.com> <83a8bn27qn.fsf@gnu.org> <80CB3488-9553-4745-82E6-A983B1608E13@raeburn.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1482487579 11105 195.159.176.226 (23 Dec 2016 10:06:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2016 10:06:19 +0000 (UTC) Cc: tino.calancha@gmail.com, 25247@debbugs.gnu.org To: Ken Raeburn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 23 11:06:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1cKMjn-0001PK-Jm for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 11:06:07 +0100 Original-Received: from localhost ([::1]:38327 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKMjs-0001qA-9f for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 05:06:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKMjm-0001q5-9B for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 05:06:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKMji-0008Dm-7q for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 05:06:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36666) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKMji-0008Dg-5Y for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 05:06:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cKMjh-0000A1-TJ for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 05:06:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Dec 2016 10:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25247 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25247-submit@debbugs.gnu.org id=B25247.1482487503545 (code B ref 25247); Fri, 23 Dec 2016 10:06:01 +0000 Original-Received: (at 25247) by debbugs.gnu.org; 23 Dec 2016 10:05:03 +0000 Original-Received: from localhost ([127.0.0.1]:52065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKMil-00008j-Em for submit@debbugs.gnu.org; Fri, 23 Dec 2016 05:05:03 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKMik-000083-5w for 25247@debbugs.gnu.org; Fri, 23 Dec 2016 05:05:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKMib-0007oQ-1x for 25247@debbugs.gnu.org; Fri, 23 Dec 2016 05:04:57 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKMia-0007oK-V2; Fri, 23 Dec 2016 05:04:52 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1916 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cKMia-0001L4-4Q; Fri, 23 Dec 2016 05:04:52 -0500 In-reply-to: <80CB3488-9553-4745-82E6-A983B1608E13@raeburn.org> (message from Ken Raeburn on Fri, 23 Dec 2016 04:34:12 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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-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:127355 Archived-At: > From: Ken Raeburn > Date: Fri, 23 Dec 2016 04:34:12 -0500 > Cc: Tino Calancha , > 25247@debbugs.gnu.org > > > It doesn't crash or hang here. Which is not surprising, since the > > backtraces seem to indicate some issue with X11/xcb and threads. Ken, > > could you take a look, please? Are we violating some X11 protocols by > > calling redisplay from different threads? > > The documentation for XInitThreads, mentioned in one of the error messages, says it needs to be called before any other Xlib functions if a single display object might be used concurrently from multiple threads. Yes, I've seen these as well. > I’m testing out a change, but thus far haven’t been able to reproduce any of the crashes even without the patch, although I did run into the unblock_input_to abort on the concurrency branch, with a similar test program from Elias Mårtenson. The problems with unblock_input_to should no longer happen on master, where I installed a fix in xgselect.c to prevent a thread from accessing the Glib context if it failed to acquire that context. The code which could cause several threads to call block_input and unblock_input, thus stomping on each other's toes, is conditioned on acquiring the Glib context, so I expected that not to be a problem anymore. However, one of the crashes reported by Tino still indicate that problem exists somehow, because one of the crashes is abort in unblock_input_to. > Also, in looking into this, I found a couple vague references about how “it is known” that there are problems with the concurrency support in Xlib in some areas. Unfortunately there were no details (not even clear if it was an Xlib problem or related to using Java classes that talk to Xlib in ways the developer might not fully control), and I’ll be busy the next few days. I’ll try to find out more next week. But if only one thread is talking to a given X display *at a time* (whether displays are assigned to specific threads, or locking is used, or only one thread uses X at all, or whatever), I haven’t seen anything so far that would suggest there would be any problem. The last crash reported by Tino here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25247#11 shows an X error even though the non-primary threads don't do any display. See the backtrace for the primary thread (the last one) in that message. So there could be more than one problem here, and GTK seems to be involved.