aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2004-01-11 11:26:00 +0000
committerKaroly Lorentey2004-01-11 11:26:00 +0000
commitc0707982ab8a080139a45b35fc7906415ba2f1bc (patch)
treee6bfdb91447dfb9704b96d4d9729064a489901a8
parent4ca927b4e0eb688a0eb224463288443164dd716f (diff)
downloademacs-c0707982ab8a080139a45b35fc7906415ba2f1bc.tar.gz
emacs-c0707982ab8a080139a45b35fc7906415ba2f1bc.zip
Don't select on stdin unconditionally.
src/process.c (init_process): Don't add stdin to input_wait_mask. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-53
-rw-r--r--README.multi-tty53
-rw-r--r--src/process.c5
2 files changed, 35 insertions, 23 deletions
diff --git a/README.multi-tty b/README.multi-tty
index 8ca1c10a2ed..816f0090377 100644
--- a/README.multi-tty
+++ b/README.multi-tty
@@ -180,29 +180,6 @@ THINGS TO DO
180 why raw terminal support is broken again. I really do need to 180 why raw terminal support is broken again. I really do need to
181 understand input.) 181 understand input.)
182 182
183** I have seen a case when Emacs with multiple ttys fell into a loop
184 eating 100% of CPU time. Strace showed this loop:
185
186 getpid() = 30284
187 kill(30284, SIGIO) = 0
188 --- SIGIO (I/O possible) @ 0 (0) ---
189 ioctl(6, FIONREAD, [0]) = -1 EIO (Input/output error)
190 ioctl(5, FIONREAD, [0]) = -1 EIO (Input/output error)
191 ioctl(0, FIONREAD, [0]) = 0
192 sigreturn() = ? (mask now [])
193 gettimeofday({1072842297, 747760}, NULL) = 0
194 gettimeofday({1072842297, 747806}, NULL) = 0
195 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
196 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
197 gettimeofday({1072842297, 748245}, NULL) = 0
198
199 I have seen something similar with a single X frame, but have not
200 been able to reproduce it for debugging.
201
202 Update: This may have been caused by checking for nread != 0
203 instead of nread > 0 after calling read_socket_hook in
204 read_avail_input.
205
206** emacsclient -t from an Emacs term buffer does not work, complains 183** emacsclient -t from an Emacs term buffer does not work, complains
207 about face problems. This can even lock up Emacs (if the recursive 184 about face problems. This can even lock up Emacs (if the recursive
208 frame sets single_kboard). Update: the face problems are caused by 185 frame sets single_kboard). Update: the face problems are caused by
@@ -537,5 +514,35 @@ DIARY OF CHANGES
537 514
538 (Done, the previous change fixes this as a pleasant side effect.) 515 (Done, the previous change fixes this as a pleasant side effect.)
539 516
517-- I have seen a case when Emacs with multiple ttys fell into a loop
518 eating 100% of CPU time. Strace showed this loop:
519
520 getpid() = 30284
521 kill(30284, SIGIO) = 0
522 --- SIGIO (I/O possible) @ 0 (0) ---
523 ioctl(6, FIONREAD, [0]) = -1 EIO (Input/output error)
524 ioctl(5, FIONREAD, [0]) = -1 EIO (Input/output error)
525 ioctl(0, FIONREAD, [0]) = 0
526 sigreturn() = ? (mask now [])
527 gettimeofday({1072842297, 747760}, NULL) = 0
528 gettimeofday({1072842297, 747806}, NULL) = 0
529 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
530 select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
531 gettimeofday({1072842297, 748245}, NULL) = 0
532
533 I have seen something similar with a single X frame, but have not
534 been able to reproduce it for debugging.
535
536 Update: This may have been caused by checking for nread != 0
537 instead of nread > 0 after calling read_socket_hook in
538 read_avail_input.
539
540 (Fixed. This was caused by unconditionally including stdin in
541 input_wait_mask in init_process. The select call in
542 wait_reading_process_input always returned immediately, indicating
543 that there is pending input from stdin, which nobody read.
544
545 Note that the above strace output seems to be an unrelated but
546 similar bug. I think that is now fixed.)
540 547
541;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d 548;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
diff --git a/src/process.c b/src/process.c
index a4ab69d5fd6..8181727bb79 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6608,7 +6608,12 @@ init_process ()
6608 process_output_skip = 0; 6608 process_output_skip = 0;
6609#endif 6609#endif
6610 6610
6611 /* Don't do this, it caused infinite select loops. The display
6612 method should call add_keyboard_wait_descriptor on stdin if it
6613 needs that. */
6614#if 0
6611 FD_SET (0, &input_wait_mask); 6615 FD_SET (0, &input_wait_mask);
6616#endif
6612 6617
6613 Vprocess_alist = Qnil; 6618 Vprocess_alist = Qnil;
6614 for (i = 0; i < MAXDESC; i++) 6619 for (i = 0; i < MAXDESC; i++)