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 10:34:04 +0200	[thread overview]
Message-ID: <83wperyrgj.fsf@gnu.org> (raw)
In-Reply-To: <87h95vmi7b.fsf@gmail.com> (message from Tino Calancha on Fri, 23 Dec 2016 12:34:48 +0900)

> From: Tino Calancha <tino.calancha@gmail.com>
> Cc: Tino Calancha <tino.calancha@gmail.com>, Ken Raeburn <raeburn@raeburn.org>, 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=<optimized out>, sigmask=<optimized out>) 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.





  reply	other threads:[~2016-12-23  8:34 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 [this message]
2016-12-23 11:32       ` Tino Calancha
2016-12-23 14:14         ` Eli Zaretskii
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=83wperyrgj.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.