all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: raeburn@raeburn.org, 25247@debbugs.gnu.org
Subject: bug#25247: 26.0.50; Concurrency crashes
Date: Fri, 23 Dec 2016 16:14:28 +0200	[thread overview]
Message-ID: <83mvfmzq9n.fsf@gnu.org> (raw)
In-Reply-To: <878tr651a9.fsf@gmail.com> (message from Tino Calancha on Fri, 23 Dec 2016 20:32:14 +0900)

> From: Tino Calancha <tino.calancha@gmail.com>
> Cc: raeburn@raeburn.org, Tino Calancha <tino.calancha@gmail.com>, 25247@debbugs.gnu.org
> Date: Fri, 23 Dec 2016 20:32:14 +0900
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> I run
> run -r -Q -l /tmp/test.el
> with /tmp/test.el:
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> (defun mytest ()
>   (dotimes (n 10)
>     (sleep-for 0.5)))
> 
> (defun run-test ()
>   (dotimes (_ 50)
>     (make-thread #'mytest)))
> 
> (run-test)
> 
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> Then i splitted windows, called a few times
> (run-test)
> and visited *Buffer List* before getting a crash.
> 
> the threads showing "really_call_select" in their backtraces are
> 1, and 155-204 (inclusive);  all but thread 158 have
> context_acquired = false
> The thread 158 is the one rising the exception, and it has
> context_acquired = true.

Thanks, this means that code in xgselect.c is doing its job well.  If
you ever again succeed in reproducing the abort in unblock_input_to,
due to level being negative, please do the same sequence of GDB
commands, and see if context_acquired is true in more than one thread.

> Thread 158 (Thread 0x7fff343f9700 (LWP 29195)):
> #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
> #1  0x00007fffefa9940a in __GI_abort () at abort.c:89
> #2  0x00007fffefa90e47 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7ffff493fc00 "!xcb_xlib_threads_sequence_lost", file=file@entry=0x7ffff493fa6b "../../src/xcb_io.c", line=line@entry=259, function=function@entry=0x7ffff493fea8 "poll_for_event") at assert.c:92
> #3  0x00007fffefa90ef2 in __GI___assert_fail (assertion=0x7ffff493fc00 "!xcb_xlib_threads_sequence_lost", file=0x7ffff493fa6b "../../src/xcb_io.c", line=259, function=0x7ffff493fea8 "poll_for_event") at assert.c:101
> #4  0x00007ffff48cd77a in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #5  0x00007ffff48cd82b in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #6  0x00007ffff48cdb1d in _XEventsQueued () from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #7  0x00007ffff48bf7e7 in XPending () from /usr/lib/x86_64-linux-gnu/libX11.so.6
> #8  0x00007ffff6712cee in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
> #9  0x00007ffff5039edd in g_main_context_prepare () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #10 0x00007ffff503a91b in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #11 0x00007ffff503aab7 in g_main_context_pending () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #12 0x000000000070fff0 in xg_select (fds_lim=14, rfds=0x7fff343f8170, wfds=0x7fff343f80f0, efds=0x0, timeout=0x7fff343f80d0, sigmask=0x0) at xgselect.c:160
> #13 0x00000000006e031a in really_call_select (arg=0x7fff343f7e70) at thread.c:520

This seems to say that we somehow still call X from more than one
thread.  I don't understand how this could happen, since sleep-for
doesn't enter redisplay, at least AFAIK.

Could it be that g_main_context_default or g_main_context_acquire or
pselect itself calls X via some GTK hook?  Hmm...  Tino, is it
possible for you to try this again, but this time with Emacs in X
synchronous mode?  The file etc/DEBUG describes 2 ways of doing that
under "If you encounter X protocol errors".  Maybe this way we will
get the X error in a different place, which will give a hint about
what's going on.

Failing that, I hope the changes that Ken is testing will fix this.

Thanks for collecting and posting all this data, Tino.





  reply	other threads:[~2016-12-23 14:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-22 10:20 bug#25247: 26.0.50; Concurrency crashes Tino Calancha
2016-12-22 17:28 ` Eli Zaretskii
2016-12-23  3:34   ` Tino Calancha
2016-12-23  8:34     ` Eli Zaretskii
2016-12-23 11:32       ` Tino Calancha
2016-12-23 14:14         ` Eli Zaretskii [this message]
2016-12-29 11:37           ` bug#25247: 26.0.50; Concurrency crashes with XLib Tino Calancha
2016-12-29 17:44             ` Eli Zaretskii
2016-12-30  3:13               ` Tino Calancha
2016-12-30  7:19             ` Ken Raeburn
2016-12-30  8:37               ` Eli Zaretskii
2016-12-30  9:41                 ` Eli Zaretskii
2016-12-30 10:30                   ` Elias Mårtenson
2016-12-30 11:05                     ` Eli Zaretskii
2016-12-30 11:21                       ` Elias Mårtenson
2016-12-30 18:54                         ` Eli Zaretskii
2016-12-30 20:40                           ` Eli Zaretskii
2016-12-31 11:05                         ` Eli Zaretskii
2016-12-31 15:34                           ` Elias Mårtenson
2016-12-31 15:51                             ` Eli Zaretskii
2016-12-31 16:24                               ` Elias Mårtenson
2016-12-31 17:18                                 ` Eli Zaretskii
2016-12-31 17:28                                   ` Elias Mårtenson
2016-12-31 18:06                                     ` Eli Zaretskii
2016-12-31 18:16                                       ` Elias Mårtenson
2016-12-31 18:29                                         ` Eli Zaretskii
2016-12-31 18:38                                           ` Eli Zaretskii
2016-12-30 13:45                   ` Tino Calancha
2016-12-30 16:57                     ` Eli Zaretskii
2017-01-06  0:03                       ` npostavs
2017-01-06  7:48                         ` Eli Zaretskii
2016-12-23  9:34   ` bug#25247: 26.0.50; Concurrency crashes Ken Raeburn
2016-12-23 10:04     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83mvfmzq9n.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=25247@debbugs.gnu.org \
    --cc=raeburn@raeburn.org \
    --cc=tino.calancha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.