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 10:34:04 +0200 Message-ID: <83wperyrgj.fsf@gnu.org> References: <87bmw4w9i2.fsf@gmail.com> <83a8bn27qn.fsf@gnu.org> <87h95vmi7b.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1482482134 18746 195.159.176.226 (23 Dec 2016 08:35:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 23 Dec 2016 08:35:34 +0000 (UTC) Cc: raeburn@raeburn.org, 25247@debbugs.gnu.org To: Tino Calancha Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 23 09:35:19 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 1cKLJn-0003Fy-2H for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 09:35:11 +0100 Original-Received: from localhost ([::1]:37922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKLJr-0006r0-Pc for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Dec 2016 03:35:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKLJj-0006pP-JZ for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 03:35:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKLJe-0005nd-Nd for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 03:35:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36650) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKLJe-0005nZ-LK for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 03:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cKLJe-0006Vi-Fk for bug-gnu-emacs@gnu.org; Fri, 23 Dec 2016 03:35:02 -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 08:35:02 +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.148248207824991 (code B ref 25247); Fri, 23 Dec 2016 08:35:02 +0000 Original-Received: (at 25247) by debbugs.gnu.org; 23 Dec 2016 08:34:38 +0000 Original-Received: from localhost ([127.0.0.1]:52049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKLJF-0006V1-RV for submit@debbugs.gnu.org; Fri, 23 Dec 2016 03:34:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cKLJE-0006Um-3K for 25247@debbugs.gnu.org; Fri, 23 Dec 2016 03:34:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKLJ5-0005ZG-Fx for 25247@debbugs.gnu.org; Fri, 23 Dec 2016 03:34:30 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKLJ5-0005ZC-E0; Fri, 23 Dec 2016 03:34:27 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1739 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cKLJ4-0008BG-JY; Fri, 23 Dec 2016 03:34:27 -0500 In-reply-to: <87h95vmi7b.fsf@gmail.com> (message from Tino Calancha on Fri, 23 Dec 2016 12:34:48 +0900) 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:127352 Archived-At: > From: Tino Calancha > Cc: Tino Calancha , Ken Raeburn , 25247@debbugs.gnu.org > Date: Fri, 23 Dec 2016 12:34:48 +0900 > > > Your patch solves one of the 2 problems: > After your patch > emacs -Q -l /tmp/test.el > with unmarked > (run-test) > starts the session. Thanks, pushed. > > If you remove the calls to 'message' from the thread function, do > > these problems go away? > Unfortunately not. > If i change test.el as follows: > (that is, without `message' calls) > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > (defun mytest () > (dotimes (n 10) > (sleep-for 0.5))) > > (defun run-test () > (dotimes (_ 50) > (make-thread #'mytest))) > > ;; (run-test) > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > And then i start session: > emacs -Q -l /tmp/test.el > > After some simple keyboard inputs i get another crash > with error: > > X protocol error: BadWindow (invalid Window parameter) on protocol request 129 > When compiled with GTK, Emacs cannot recover from X disconnects. > This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715 > For details, see etc/PROBLEMS. > Fatal error 6: Aborted > > And backtraces: > > (gdb) thread apply all bt Please do: (gdb) thread apply all frame 1 (gdb) thread apply all print context_acquired The last command will print an error for a few threads, but that's okay. I hope it will still print the values for the 48 threads that are waiting inside xg_select. If not, I will have to ask you to do that manually, like this: (gdb) thread 54 (gdb) frame 1 (gdb) p context_acquired (gdb) thread 53 (gdb) frame 1 (gdb) p context_acquired etc., for all of the threads that show backtrace like this: > Thread 54 (Thread 0x7fffbda64700 (LWP 5463)): > #0 0x00007fffefb4638c in __pselect (nfds=14, readfds=0x7fffbda62c40, writefds=0x7fffbda62bc0, exceptfds=0x0, timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:69 > #1 0x000000000070fe80 in xg_select (fds_lim=14, rfds=0x7fffbda63170, wfds=0x7fffbda630f0, efds=0x0, timeout=0x7fffbda630d0, sigmask=0x0) at xgselect.c:116 > #2 0x00000000006e031a in really_call_select (arg=0x7fffbda62e70) at thread.c:520 The number 54 in the "Thread 54" part of the header is the number you give in the GDB "thread N" command above. The expected result of all this is that only one thread has context_acquired set to TRUE, the rest should have it FALSE. If that doesn't happen, we are somehow violating the Glib protocol of using its context for reading events, and all kinds of problems could happen. > I get similar crashes after applying your patch. That patch wasn't supposed to fix those, only the one with unaligned pointers that caused an abort in GC. Thanks.