unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 16737@debbugs.gnu.org, sujith@msujith.org, dmantipov@yandex.ru
Subject: bug#16737: 24.3.50; Yank causes hang
Date: Wed, 05 Mar 2014 12:01:06 +0100	[thread overview]
Message-ID: <531703F2.3010601@yahoo.fr> (raw)
In-Reply-To: <83d2i1sxvp.fsf@gnu.org>

Le 04/03/2014 17:59, Eli Zaretskii a écrit :
> Since you say that Emacs hangs for several seconds, would it be
> possible for you to attach GDB right after you type C-x C-e to eval
> (x-get-selection)?  You could prepare the "gdb -p PID" command line in
> the shell window in advance, so all you'd need to type is RET.

I didn't quite do that and unfortunately killed the process at the end,
so can't try your suggestion anymore. FWIW, here's what I did, although
I doubt it's very useful. I'll try to do better next time.

(gdb) break Fx_get_selection_internal 
Breakpoint 4 at 0x813c820: file xselect.c, line 1998.
(gdb) c
Continuing.

## Here I go to emacs and hit C-x C-e to evaluate (x-get-selection 'secondary)

Breakpoint 4, Fx_get_selection_internal (selection_symbol=149985546, target_type=139439426, time_stamp=139286466, terminal=139286466) at xselect.c:1998
1998	  Lisp_Object val = Qnil;
(gdb) info  locals 
val = 135564854
gcpro1 = {
  next = 0xbf39428, 
  var = 0xc, 
  nvars = 0
}
gcpro2 = {
  next = 0xf, 
  var = 0xbfffd7d8, 
  nvars = 135564854
}
f = 0xbfffd7f8
(gdb) n
2000	  struct frame *f = frame_for_x_selection (terminal);
(gdb) 
2003	  CHECK_SYMBOL (selection_symbol);
(gdb) 
2004	  CHECK_SYMBOL (target_type);
(gdb) 
2005	  if (EQ (target_type, QMULTIPLE))
(gdb) 
2007	  if (!f)
(gdb) 
2011				       FRAME_DISPLAY_INFO (f));
(gdb) 
2010	  val = x_get_local_selection (selection_symbol, target_type, 1,
(gdb) 
2013	  if (NILP (val) && FRAME_LIVE_P (f))
(gdb) 
2016	      XSETFRAME (frame, f);
(gdb) 
2017	      RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, target_type,
(gdb) 
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0xe4d00845: Erreur d'entrée/sortie.

## At this point my emacs entered the debugger with (error "Timed out waiting for reply from selection owner")
## Hitting 'c' in emacs returns to gdb :

0xb6cb07e1 in __libc_siglongjmp (env=0x8899758, val=1) at longjmp.c:29
29	longjmp.c: Aucun fichier ou dossier de ce type.
(gdb) 

\f
Let's try another recipe:
## Here I go to emacs and hit C-x C-e after (x-get-selection 'secondary)
       
Breakpoint 4, Fx_get_selection_internal (selection_symbol=149985546, target_type=139439426, time_stamp=139286466, terminal=139286466) at xselect.c:1998
1998	  Lisp_Object val = Qnil;
(gdb) n
2000	  struct frame *f = frame_for_x_selection (terminal);
(gdb) 
2003	  CHECK_SYMBOL (selection_symbol);
(gdb) 
2004	  CHECK_SYMBOL (target_type);
(gdb) 
2005	  if (EQ (target_type, QMULTIPLE))
(gdb) 
2007	  if (!f)
(gdb) 
2011				       FRAME_DISPLAY_INFO (f));
(gdb) 
2010	  val = x_get_local_selection (selection_symbol, target_type, 1,
(gdb) 
2013	  if (NILP (val) && FRAME_LIVE_P (f))
(gdb) 
2016	      XSETFRAME (frame, f);
(gdb) 
2017	      RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, target_type,
(gdb) s
x_get_foreign_selection (selection_symbol=149985546, target_type=139439426, time_stamp=139286466, frame=142123853) at xselect.c:1186
1186	  struct frame *f = XFRAME (frame);
(gdb) n
1187	  struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
(gdb) 
1188	  Display *display = dpyinfo->display;
(gdb) 
1189	  Window requestor_window = FRAME_X_WINDOW (f);
(gdb) 
1190	  Time requestor_time = dpyinfo->last_user_time;
(gdb) 
1191	  Atom target_property = dpyinfo->Xatom_EMACS_TMP;
(gdb) 
1192	  Atom selection_atom = symbol_to_x_atom (dpyinfo, selection_symbol);
(gdb) 
1193	  Atom type_atom = (CONSP (target_type)
(gdb) 
1195			    : symbol_to_x_atom (dpyinfo, target_type));
(gdb) 
1193	  Atom type_atom = (CONSP (target_type)
(gdb) 
1199	  if (!FRAME_LIVE_P (f))
(gdb) 
1202	  if (! NILP (time_stamp))
(gdb) 
1205	  block_input ();
(gdb) 
1210	  x_catch_errors (display);
(gdb) 
1211	  XConvertSelection (display, selection_atom, type_atom, target_property,
(gdb) 
1213	  x_check_errors (display, "Can't convert selection: %s");
(gdb) 
1214	  x_uncatch_errors ();
(gdb) 
1217	  reading_selection_window = requestor_window;
(gdb) 
1218	  reading_which_selection = selection_atom;
(gdb) 
1219	  XSETCAR (reading_selection_reply, Qnil);
(gdb) 
1230	  unblock_input ();
(gdb) 
1233	  timeout = max (0, x_selection_timeout);
(gdb) 
1234	  secs = timeout / 1000;
(gdb) 
1235	  nsecs = (timeout % 1000) * 1000000;
(gdb) 
1237	  wait_reading_process_output (secs, nsecs, 0, 0,

## At this point, it indeed waited for a few seconds

(gdb) 
1241	  if (NILP (XCAR (reading_selection_reply)))
(gdb) 
1242	    error ("Timed out waiting for reply from selection owner");
(gdb) 
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0xe4d9da45: Erreur d'entrée/sortie.

deliver_profiler_signal (signal=27) at profiler.c:250
250	{
(gdb) n
251	  deliver_process_signal (signal, handle_profiler_signal);
(gdb) 

Program received signal SIGTRAP, Trace/breakpoint trap.
0x08168cbd in deliver_process_signal (sig=27, handler=0x8229d01 <handle_profiler_signal>) at sysdep.c:1550
1550	{
(gdb) 
1553	  int old_errno = errno;
(gdb) 

Program received signal SIGTRAP, Trace/breakpoint trap.
__errno_location () at ../csu/errno-loc.c:25
25	../csu/errno-loc.c: Aucun fichier ou dossier de ce type.
(gdb) 

Program received signal SIGTRAP, Trace/breakpoint trap.
0xb6e43baa in __i686.get_pc_thunk.cx () from /lib/libpthread.so.0
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xb6e4eae5 in __errno_location () at ../csu/errno-loc.c:25
25	in ../csu/errno-loc.c
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
__errno_location () at ../csu/errno-loc.c:26
26	in ../csu/errno-loc.c
(gdb) 
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
0xb6e4eaf1 in __errno_location () at ../csu/errno-loc.c:26
26	in ../csu/errno-loc.c
(gdb) 
Continuing.

## After hitting RET a few more times, I got bored and did :

(gdb) handle SIGTRAP pass
SIGTRAP is used by the debugger.
Are you sure you want to change it? (y or n) y 
Signal        Stop	Print	Pass to program	Description
SIGTRAP       Yes	Yes	Yes		Trace/breakpoint trap
(gdb) c
Continuing.
[Thread 0xb1435b40 (LWP 5760) exited]
[Thread 0xb1c36b40 (LWP 5759) exited]
[Thread 0xb4f11b40 (LWP 22285) exited]
[Thread 0xb596eb40 (LWP 22284) exited]
[Thread 0xb639bb40 (LWP 22283) exited]

Program terminated with signal SIGTRAP, Trace/breakpoint trap.
The program no longer exists.
(gdb) 

## Perhaps this wasn't exactly the right thing to do -- sorry about
## that.

-- 
Nico.





  reply	other threads:[~2014-03-05 11:01 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13  3:40 bug#16737: 24.3.50; Yank causes hang Sujith Manoharan
2014-02-13  5:22 ` Dmitry Antipov
2014-02-19 16:04   ` Sujith Manoharan
2014-03-04 12:47   ` Nicolas Richard
2014-03-04 16:59     ` Eli Zaretskii
2014-03-05 11:01       ` Nicolas Richard [this message]
2014-03-05 17:08         ` Eli Zaretskii
2014-03-21  6:19           ` Nicolas Richard
2014-03-21  6:28             ` Nicolas Richard
2014-03-21  6:42               ` Nicolas Richard
2014-03-21  8:18               ` Eli Zaretskii
2014-03-21  8:17             ` Eli Zaretskii
2014-03-27  9:34               ` Nicolas Richard
2014-02-13 10:23 ` Nicolas Richard
2014-06-25 16:04 ` bug#16737: Timed out waiting for reply from selection owner Stefan Monnier
2014-06-25 18:07   ` Alex Bennée
2015-06-03 15:18     ` Tassilo Horn
2015-06-03 15:35       ` Alex Bennée
2015-06-03 15:39         ` bug#20283: " Oleh Krehel
2015-06-05  9:26           ` Alex Bennée
2014-06-25 18:28   ` Jan Djärv
2014-06-25 19:56     ` Stefan Monnier
2014-07-21 15:02     ` Alex Bennée
2014-11-21 10:53     ` Tom Tromey
2014-06-25 19:58   ` Nicolas Richard
2014-09-25 20:43 ` bug#16737: Autoloading `safe-local-variable' properties Stefan Monnier
2014-11-11 12:37 ` bug#16737: Yank causes hang in v24.4.1 Mike Crowe
2014-11-11 13:26   ` Mike Crowe
2015-01-17 14:38 ` bug#16737: Timed out waiting for reply from selection owner Oleh Krehel
2015-01-17 14:56   ` Eli Zaretskii
2015-01-17 15:34     ` Oleh Krehel
2015-01-17 18:07       ` Eli Zaretskii
2015-01-17 21:43         ` Vincent Bernat
2015-01-17 21:45           ` Vincent Bernat
2015-01-19 17:46           ` Eli Zaretskii
2015-01-27 16:43             ` Vincent Bernat
2015-01-27 17:42               ` Eli Zaretskii
2015-01-27 18:16                 ` Vincent Bernat
2015-01-28  9:54                   ` Nicolas Richard
2015-01-28 10:16                     ` Vincent Bernat
2015-01-28 14:14                       ` Vincent Bernat
2015-01-28 14:23               ` Oleh Krehel
2015-01-27 10:43         ` Oleh Krehel
2015-01-27 17:43           ` Eli Zaretskii
2015-01-27 18:05             ` Oleh Krehel
2015-01-27 19:10               ` Eli Zaretskii
2015-04-04 14:12 ` bug#16737: 24.3.50; Yank causes hang Jan Djärv
2015-06-04 13:42 ` bug#16737: Timed out waiting for reply from selection owner Alan D. Salewski
2015-06-05 14:36   ` Alan D. Salewski
2015-06-15  3:00     ` Alan D. Salewski
2015-06-16 11:10       ` Oleh Krehel
2015-06-23 23:45       ` Stefan Monnier
2015-07-08 20:54 ` bug#16737: A bit of digging Mike Crowe
2015-07-09 12:44   ` bug#16737: Possible patch Mike Crowe
2015-07-15 18:36     ` bug#16737: Emacs bug #16737: " Mike Crowe
2015-07-16  8:32       ` Tassilo Horn
2015-07-17 19:58         ` Martin Renold
2015-07-17 19:08 ` bug#16737: Patch for "Yank causes hang" bug in Emacs Paul Eggert
2015-07-18  5:16   ` Sujith Manoharan
2015-09-26  4:39   ` bug#19320: " Mitchel Humpherys

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=531703F2.3010601@yahoo.fr \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=16737@debbugs.gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=sujith@msujith.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).