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 with XLib Date: Thu, 29 Dec 2016 19:44:40 +0200 Message-ID: <83tw9mtyt3.fsf@gnu.org> References: <87bmw4w9i2.fsf@gmail.com> <83a8bn27qn.fsf@gnu.org> <87h95vmi7b.fsf@gmail.com> <83wperyrgj.fsf@gnu.org> <878tr651a9.fsf@gmail.com> <83mvfmzq9n.fsf@gnu.org> <87shp7j790.fsf_-_@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1483033519 26307 195.159.176.226 (29 Dec 2016 17:45:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 29 Dec 2016 17:45:19 +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 Thu Dec 29 18:45:14 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 1cMelI-0005gZ-I0 for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Dec 2016 18:45:08 +0100 Original-Received: from localhost ([::1]:36712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMelN-0008LT-Co for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Dec 2016 12:45:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMelE-0008JX-5T for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 12:45:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMelC-00057n-Np for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 12:45:04 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43964) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cMelC-00057e-Js for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 12:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cMelC-0008L1-DC for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2016 12:45: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: Thu, 29 Dec 2016 17:45: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.148303349932026 (code B ref 25247); Thu, 29 Dec 2016 17:45:02 +0000 Original-Received: (at 25247) by debbugs.gnu.org; 29 Dec 2016 17:44:59 +0000 Original-Received: from localhost ([127.0.0.1]:59363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMel8-0008KT-JZ for submit@debbugs.gnu.org; Thu, 29 Dec 2016 12:44:59 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:49592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cMel6-0008KE-LF for 25247@debbugs.gnu.org; Thu, 29 Dec 2016 12:44:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMekx-0004wW-Fw for 25247@debbugs.gnu.org; Thu, 29 Dec 2016 12:44:51 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMekx-0004wQ-CS; Thu, 29 Dec 2016 12:44:47 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1339 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cMekw-0001qS-5g; Thu, 29 Dec 2016 12:44:46 -0500 In-reply-to: <87shp7j790.fsf_-_@gmail.com> (message from Tino Calancha on Thu, 29 Dec 2016 20:37:47 +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:127554 Archived-At: > From: Tino Calancha > Cc: raeburn@raeburn.org, 25247@debbugs.gnu.org, tino.calancha@gmail.com > Date: Thu, 29 Dec 2016 20:37:47 +0900 > > It's worth to note that in _any_ case i've seen more than 1 thread with > context_acquired = true. You mean, in no case, right? > Thread 10 (Thread 0x7fffdd151700 (LWP 27549)): > #0 raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:58 > set = {__val = {402653184, 0, 18446744073709551615, 18446744073709551615, 0, 0, 18446744073709551615, 18446744073709551615, 0, 0, 0, 0, 0, 0, 30768, 140737251463819}} > pid = > tid = > #1 0x000000000058f90f in terminate_due_to_signal (sig=6, backtrace_limit=40) at emacs.c:395 > No locals. > #2 0x00000000005bdf0e in emacs_abort () at sysdep.c:2364 > No locals. > #3 0x00000000005a3a38 in unblock_input_to (level=-1) at keyboard.c:7170 > No locals. > #4 0x00000000005a3a4f in unblock_input () at keyboard.c:7186 > No locals. > #5 0x0000000000552f34 in XTread_socket (terminal=0x1371e40 , hold_quit=0x7fffdd14fa80) at xterm.c:8943 > count = 0 > event_found = false > dpyinfo = 0x2f5ad40 > #6 0x00000000005a343d in gobble_input () at keyboard.c:6883 > nr = 0 > hold_quit = {kind = NO_EVENT, part = scroll_bar_nowhere, code = 0, modifiers = 0, x = {i = 0}, y = {i = 0}, timestamp = 0, frame_or_window = {i = 0}, arg = {i = 0}} > next = 0x0 > nread = 0 > err = false > t = 0x1371e40 > #7 0x00000000005a39cc in handle_async_input () at keyboard.c:7138 > nread = 0 > #8 0x00000000005a39eb in process_pending_signals () at keyboard.c:7152 > No locals. > #9 0x00000000005a3a2b in unblock_input_to (level=0) at keyboard.c:7167 > No locals. > #10 0x00000000005a3a4f in unblock_input () at keyboard.c:7186 > No locals. > #11 0x000000000070c8f3 in xg_select (fds_lim=14, rfds=0x7fffdd150580, wfds=0x7fffdd150500, efds=0x0, timeout=0x7fffdd1504e0, sigmask=0x0) at xgselect.c:162 This is weird. It seems some other thread called unblock_input while this thread was in process_pending_signals. Not sure how that could happen. > Thread 10 (Thread 0x7fffdf295700 (LWP 27925)): > #0 deliver_input_available_signal (sig=1496990316) at keyboard.c:7211 > No locals. > #1 > No locals. > #2 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135 > No locals. > #3 0x00007ffff044abc5 in __GI___pthread_mutex_lock (mutex=0xe15da0 ) at ../nptl/pthread_mutex_lock.c:80 > __PRETTY_FUNCTION__ = "__pthread_mutex_lock" > type = 0 > id = > #4 0x00000000006ddb62 in sys_mutex_lock (mutex=0xe15da0 ) at systhread.c:113 > No locals. > #5 0x00000000006dc11c in acquire_global_lock (self=0x3630038) at thread.c:100 > No locals. > #6 0x00000000006dcc88 in really_call_select (arg=0x7fffdf294280) at thread.c:524 This thread got a SIGIO signal while waiting to acquire the global lock. It then delivered SIGIO to the main thread. > Thread 1 (Thread 0x7ffff7f16b00 (LWP 27912)): > #0 raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:58 > set = {__val = {402653184, 0, 18446744073709551615, 18446744073709551615, 0, 0, 18446744073709551615, 18446744073709551615, 0, 0, 0, 0, 0, 0, 0, 0}} > pid = > tid = > #1 0x000000000058f90f in terminate_due_to_signal (sig=6, backtrace_limit=40) at emacs.c:395 > No locals. > #2 0x00000000005bdf0e in emacs_abort () at sysdep.c:2364 > No locals. > #3 0x00000000005546c2 in x_connection_closed (dpy=0x2e736f0, error_message=0x7fffffff9a60 "Connection lost to X server ':0'", ioerror=true) at xterm.c:9582 > dpyinfo = 0x2f94330 > frame = {i = 21330997} > tail = {i = 0} > idx = 7 > #4 0x00000000005548be in x_io_error_quitter (display=0x2e736f0) at xterm.c:9685 > buf = "Connection lost to X server ':0'\000\035\006\365\377\177\000\000\240Jf\003", '\000' , "`\035\006\365\377\177\000\000`Y\\\003", '\000' , "`\035\006\365\377\177\000\000\360\034]\003", '\000' , "@I\347\002\000\000\000\000\000\312[\003", '\000' , "XI\347\002\000\000\000\000\240\233\377\377\377\177\000\000\300L\345\002\000\000\000\000"... > #5 0x00007ffff48c32de in _XIOError () from /usr/lib/x86_64-linux-gnu/libX11.so.6 > No symbol table info available. > #6 0x00007ffff48c1323 in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6 > No symbol table info available. > #7 0x00007ffff48bcb1d in XSync () from /usr/lib/x86_64-linux-gnu/libX11.so.6 > No symbol table info available. > #8 0x00007ffff66f0a41 in gdk_window_process_all_updates () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 > No symbol table info available. > #9 0x0000000000564beb in x_sync (f=0x1457c30 ) at xfns.c:5147 > No locals. > #10 0x000000000057df90 in xg_update_scrollbar_pos (f=0x1457c30 , scrollbar_id=0, top=0, left=1170, width=16, height=272) at gtkutil.c:3785 The main thread was doing redisplay, and received an X error. Could it be that delivering SIGIO to the main thread while it was in XSync call caused the X error? Ken, is that possible? I think there'll be a need to move the code which releases and acquires the global lock into xgselect.c. Thanks.