From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: 8869@debbugs.gnu.org
Subject: bug#8869: Unjustified selection time-out
Date: Sun, 19 Jun 2011 13:14:40 +0200 [thread overview]
Message-ID: <4DFDDA20.9010906@swipnet.se> (raw)
In-Reply-To: <4DFDCEF0.5060509@swipnet.se>
Hi.
Some more debugging.
At the top of the while loop in wait_reading_process_output, there is this:
if (read_kbd >= 0)
QUIT;
#ifdef SYNC_INPUT
else
process_pending_signals ();
#endif
This is the code that reads the SelectionRequest and queues it.
But from here on, there is no code that checks if input is pending, so the
function gets stuck in select a bit down.
There is a check before select:
if (read_kbd && detect_input_pending ())
{
nfds = 0;
no_avail = 1;
}
This fails for two reasons. In this situation, read_kbd is zero.
Also, setting nfds to zero makes the selection code think it timed out.
Adding this patch:
=== modified file 'src/process.c'
--- src/process.c 2011-06-14 18:57:19 +0000
+++ src/process.c 2011-06-19 11:09:30 +0000
@@ -4484,6 +4484,11 @@
nfds = 0;
no_avail = 1;
}
+ else if (read_kbd == 0 && detect_input_pending ())
+ {
+ nfds = 1;
+ no_avail = 1;
+ }
else
{
fixes the timeout issue in this report, but probably has some bad effect
elsewhere.
Jan D.
Jan Djärv skrev 2011-06-19 12.26:
> Hi.
>
> There is something wrong with the implementation for SAVE_TARGETS.
> What happens is:
>
> 1) Emacs sends SAVE_TARGET and starts to wait for SelectionNotify.
> 2) The clipboard manager tries to get the CLIPBOARD selection with a
> SelectionRequest.
> 3) Emacs receives this but does not reply to it, as it is only intereted in
> SelectionNotify.
> 4) If an input event, such as mouse move, occurs, the loop is broken and all
> queued X Events are handeled, including SelectionRequest.
> 5) The clipboard manager has gotten the clipboard from Emacs and only now
> sends SelectionNotify.
>
> Thus, if there isn't any input in 4), the exit will time out.
> Emacs must handle SelectionRequest in 3) to work correctly.
>
> Jan D.
>
>
> Chong Yidong skrev 2011-06-19 00.03:
>> David De La Harpe Golden<david@harpegolden.net> writes:
>>
>>>> - standard Debian testing Gnome setup.
>>>> - killall metacity.
>>>> - start good'ol ctwm, emacs, and xterm.
>>>
>>> Well, if you're literally doing that, that will tend to leave bits of
>>> gnome hanging about.
>>
>> Yeah, though that doesn't explain why "no other application seems to
>> exhibit such a delay when exiting". Plenty of other applications ought
>> to be supporting the clipboard manager spec these days.
>>
>> There are various possible workarounds, e.g. we could have
>> x_clipboard_manager_save_frame set x-select-enable-clipboard-manager to
>> nil if it hits a timeout, so that the delay at least won't recur in the
>> same session. But it wouldn't be wise to implement them until we get a
>> few more details about the actual failure case.
>>
>>
>
>
next prev parent reply other threads:[~2011-06-19 11:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-15 15:42 bug#8869: Unjustified selection time-out Stefan Monnier
2011-06-16 1:00 ` David De La Harpe Golden
2011-06-16 6:58 ` Jan D.
2011-06-16 13:44 ` Stefan Monnier
2011-06-16 15:36 ` David De La Harpe Golden
2011-06-17 2:56 ` Stefan Monnier
2011-06-17 18:11 ` David De La Harpe Golden
2011-06-18 22:03 ` Chong Yidong
2011-06-19 10:26 ` Jan Djärv
2011-06-19 11:14 ` Jan Djärv [this message]
2011-06-26 3:40 ` Chong Yidong
2011-06-26 8:36 ` Jan Djärv
2011-06-26 19:30 ` Chong Yidong
2011-07-01 1:32 ` Stefan Monnier
2011-07-01 7:05 ` Jan Djärv
2011-07-04 14:55 ` Stefan Monnier
2011-07-06 13:29 ` Stefan Monnier
2011-07-08 2:07 ` David De La Harpe Golden
2011-07-08 2:20 ` Stefan Monnier
2011-07-08 2:40 ` David De La Harpe Golden
2011-07-08 12:59 ` Stefan Monnier
2012-02-24 2:47 ` Glenn Morris
2012-02-24 8:42 ` Chong Yidong
2012-02-24 18:52 ` Glenn Morris
2012-02-24 23:52 ` Glenn Morris
2012-02-25 3:00 ` Chong Yidong
2011-06-19 19:59 ` Chong Yidong
2011-06-19 20:45 ` Jan Djärv
2011-06-19 21:13 ` Chong Yidong
2011-06-20 6:27 ` Jan Djärv
2011-06-20 14:57 ` Chong Yidong
2011-06-20 15:24 ` Jan Djärv
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=4DFDDA20.9010906@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=8869@debbugs.gnu.org \
--cc=cyd@stupidchicken.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 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).