From: Dov Grobgeld <dov.grobgeld@gmail.com>
To: Chong Yidong <cyd@gnu.org>
Cc: 10580@debbugs.gnu.org
Subject: bug#10580: 24.0.92; gdb initialization takes more than one minute at 100% CPU
Date: Tue, 8 May 2012 10:56:21 +0300 [thread overview]
Message-ID: <CA++fsGF+ykZPmemCELPk-RzitWFC=bde1uEGRAJjLieg-ms6Vw@mail.gmail.com> (raw)
In-Reply-To: <CA++fsGF6nmZ6V5_8Fhh886fSwR0Z-PeR_xoFQDeQ+g4DtTdMCA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2493 bytes --]
Some more info that I found through strace that might help. Alltogether
read_process_output() is called 214 times and thus a total of 870k of text
is read through /dev/ptmx to read_process_output() . Could the amount of
data possibly explain the slowness?
Regards,
Dov
On Tue, May 8, 2012 at 8:33 AM, Dov Grobgeld <dov.grobgeld@gmail.com> wrote:
> I added the above patch and the result is as follows:
>
> After the following two lines:
>
>
> nread = read_process_output (proc, channel);
>
> pp = XPROCESS(proc);
>
> nread==4095, pp->pid=1234 repeatedly. (Actually 1234 seems to be an
> arbitrary, but constant number between 1000 and 2000).
>
> This seems strange, as obviously the sub-process does not produce 4095
> characters repeatedly.
>
> Thanks,
> Dov
>
> On Mon, May 7, 2012 at 9:26 AM, Chong Yidong <cyd@gnu.org> wrote:
>
>> Actually, try the following patch instead (apparently gdb has some
>> issues with printing errno). Apply the patch, then when Emacs is taking
>> 100% CPU do an interrupt and set the breakpoint at process.c:4855, then
>> when the breakpoint triggers do
>>
>> n
>> p nread
>> p errno
>>
>> and step through the subsequent if/else blocks. Thanks.
>>
>> Basically, the 100% CPU appears to be because Emacs' select() call keeps
>> getting worken up by the pty attached to your program. But, for some
>> reason, no actual output being read from that pty. These debugging
>> steps are trying to figure out if some uncaught errno is being reported
>> by the pty read.
>>
>>
>> === modified file 'src/process.c'
>> *** src/process.c 2012-04-20 06:39:29 +0000
>> --- src/process.c 2012-05-07 06:21:39 +0000
>> ***************
>> *** 4822,4827 ****
>> --- 4822,4829 ----
>> && !FD_ISSET (channel, &non_process_wait_mask))
>> {
>> int nread;
>> + int saved_errno = 0;
>> + struct Lisp_Process *pp;
>>
>> /* If waiting for this channel, arrange to return as
>> soon as no more input to be processed. No more
>> ***************
>> *** 4847,4852 ****
>> --- 4849,4859 ----
>> buffered-ahead character if we have one. */
>>
>> nread = read_process_output (proc, channel);
>> +
>> + pp = XPROCESS (proc);
>> + if (pp->pid == -2)
>> + saved_errno = errno;
>> +
>> if (nread > 0)
>> {
>> /* Since read_process_output can run a filter,
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 3522 bytes --]
next prev parent reply other threads:[~2012-05-08 7:56 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-22 12:42 bug#10580: 24.0.92; gdb initialization takes more than one minute at 100% CPU Dov Grobgeld
2012-01-23 0:53 ` Glenn Morris
[not found] ` <CA++fsGG4YuTtb2VC9R+GRcPN5+JSaKpkb+uO3WAX0+VXmh8HDQ@mail.gmail.com>
2012-01-23 9:21 ` Glenn Morris
2012-01-25 0:37 ` Glenn Morris
2012-01-25 8:49 ` Dov Grobgeld
2012-01-25 9:39 ` Dov Grobgeld
2012-01-25 19:05 ` Glenn Morris
2012-04-30 5:33 ` Dov Grobgeld
2012-04-30 6:36 ` Dov Grobgeld
2012-05-06 4:13 ` Chong Yidong
2012-05-06 4:55 ` Dov Grobgeld
2012-05-06 5:39 ` Chong Yidong
2012-05-06 7:06 ` Dov Grobgeld
2012-05-07 2:53 ` Chong Yidong
2012-05-07 5:07 ` Dov Grobgeld
2012-05-07 6:11 ` Chong Yidong
2012-05-07 6:26 ` Chong Yidong
2012-05-08 5:33 ` Dov Grobgeld
2012-05-08 7:56 ` Dov Grobgeld [this message]
2012-05-08 8:28 ` Chong Yidong
2012-05-08 11:59 ` Dov Grobgeld
2012-05-08 16:25 ` Chong Yidong
2012-05-08 17:47 ` Eli Zaretskii
2012-05-08 21:07 ` Dov Grobgeld
2012-05-08 21:24 ` Andreas Schwab
2012-05-08 21:30 ` Dov Grobgeld
2012-05-09 7:47 ` Andreas Schwab
2012-05-09 8:44 ` Dov Grobgeld
2012-05-09 17:36 ` Eli Zaretskii
2012-05-10 6:00 ` Dov Grobgeld
2012-05-10 14:13 ` Chong Yidong
2012-05-10 19:07 ` Dov Grobgeld
2012-05-10 20:25 ` Stefan Monnier
2012-05-11 6:33 ` Chong Yidong
2012-05-11 8:29 ` Dov Grobgeld
2012-05-11 9:47 ` Eli Zaretskii
2012-05-11 13:27 ` Chong Yidong
2012-11-05 20:36 ` Dov Grobgeld
2012-11-05 20:46 ` Eli Zaretskii
2012-11-05 23:51 ` Stefan Monnier
2012-05-10 16:32 ` Eli Zaretskii
2012-05-10 18:43 ` Dov Grobgeld
2012-05-08 17:38 ` Eli Zaretskii
2012-12-14 4:14 ` bug#10580: 24.0.92; gdb initialization takes more than one minute at 100 Jean-Philippe Gravel
2012-12-18 4:45 ` Jean-Philippe Gravel
2012-12-21 4:01 ` Chong Yidong
2013-03-01 3:31 ` Jean-Philippe Gravel
2013-03-11 17:14 ` Stefan Monnier
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='CA++fsGF+ykZPmemCELPk-RzitWFC=bde1uEGRAJjLieg-ms6Vw@mail.gmail.com' \
--to=dov.grobgeld@gmail.com \
--cc=10580@debbugs.gnu.org \
--cc=cyd@gnu.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).