delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/01/10:18:50

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=Z5Z3H76D41AZIHuIVKC2T5KoqdNRDBI1xhyLjatm1fM9mnX70HxBW
JYzNrVJU0rguTnUqauDyNvNnOXQ6WhTMwv48bduQIMuvmwY8s1Ofvr9A1M6fAI+P
WxQR+36NPiYE86pjmtA3GNOMQN8bzleFlejyy8fToII0gUviysjSJ4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=PmasiNHGP7cUg16YEAefOsBTXcQ=; b=UZ6LjUOyvthGSddkHxlg966aTtUo
HQqLQpbxWIK7ajgz3F9f9PCiaxceZc31kN2qED4p/C1iSDUTtyNcIuaA3cyvgxih
9Nk36pIAAyHrLB85K/EXDddGZ/nWpS/LexzQtbhQHO74AdDBnUGHz0N6YmML8y+y
Mf6li2Bi5UcsKmY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-96.1 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=H*Ad:D*ne.jp, HTo:D*ne.jp, online, sleep
X-HELO: calimero.vinschen.de
Date: Wed, 1 Jun 2016 16:18:20 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com, Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
Subject: Re: gdb pty problem [Was: emacs gud-interface is not updated after gdb command execution (maybe because of incomplete output from gdb)]
Message-ID: <20160601141820.GF11431@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
References: <466943424 DOT 37628 DOT 394d161a-7219-415d-a659-0f774811ad2d DOT open-xchange AT email DOT 1und1 DOT de> <44459aa0-4381-2368-ab63-5dffc26f3344 AT cornell DOT edu> <e29d08b0-aaed-46ea-a4eb-960b1e462692 AT cornell DOT edu> <a50d8bef-cc9b-3b35-8812-b26360591662 AT cornell DOT edu> <20160531094115 DOT GE24015 AT calimero DOT vinschen DOT de> <34c9cf10-4930-a017-92fc-fd56171671b1 AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <34c9cf10-4930-a017-92fc-fd56171671b1@cornell.edu>
User-Agent: Mutt/1.6.1 (2016-04-27)

--oj4kGyHlBMXGt3Le
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi Takashi,


can you please have a look?


Thanks,
Corinna


On Jun  1 08:51, Ken Brown wrote:
> On 5/31/2016 5:41 AM, Corinna Vinschen wrote:
> > Any chance you could bisect Cygwin to help finding the culprit?
>=20
> The culprit is
>=20
> commit 252a07b0ad3353abcd0fcd9b1b65ff977acd679e
> Author: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
> Date:   Fri Apr 3 13:07:35 2015 +0900
>=20
>    Cygwin hangs up if several keys are typed during outputting a lot of t=
exts.
>=20
>        * fhandler_tty.cc (fhandler_pty_slave::read): Change calculation of
>        "readlen" not to use "bytes_in_pipe" value directly.
>=20
>=20
> Reverting that commit fixes the problem.  To test, compile and run the at=
tached file.
>=20
> $ gcc gdbstc.cc
>=20
> $ ./a
> 1-inferior-tty-set /dev/pty3
> 2-gdb-set height 0
> 3-gdb-set non-stop 1
> 4-file-list-exec-source-files
> 5-file-list-exec-source-file
> 6-gdb-show prompt
> 7-stack-info-frame
> 8-thread-info
> 9-break-list
> q
> *** using gdb
> =3Dthread-group-added,id=3D"i1"
> ~"GNU gdb (GDB) (Cygwin 7.10.1-1) 7.10.1\n"
> ~"Copyright (C) 2015 Free Software Foundation, Inc.\n"
> ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl=
.html>\nThis is free software: you are free to change and redistribute it.\=
nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying=
\"\nand \"show warranty\" for details.\n"
> ~"This GDB was configured as \"i686-pc-cygwin\".\nType \"show configurati=
on\" for configuration details."
> ~"\nFor bug reporting instructions, please see:\n"
> ~"<http://www.gnu.org/software/gdb/bugs/>.\n"
> ~"Find the GDB manual and other documentation resources online at:\n<http=
://www.gnu.org/software/gdb/documentation/>.\n"
> ~"For help, type \"help\".\n"
> ~"Type \"apropos word\" to search for commands related to \"word\".\n"
> =3Dcmd-param-changed,param=3D"auto-load safe-path",value=3D"/"
> (gdb)
> ...
>=20
> In bad cases (bug present), the program hangs and doesn't complete until =
the gdb process is killed from a different terminal.  In good cases it runs=
 to completion.
>=20
> Ken

> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <pty.h>
> #include <string.h>
> #include <sys/wait.h>
>=20
> void get_output (int fd);
>=20
> int
> main (int argc, const char **argv)=20
> {
>   int master;
>   pid_t pid;
>=20
>   if ((pid =3D forkpty (&master, NULL, NULL, NULL)) < 0)
>     {
>       perror ("forkpty");
>       exit (1);
>     }
>   /* child */
>   if (pid =3D=3D 0)=20
>     {
>       const char *av[100];
>       // putenv ("HOME=3D/tmp");
>       int i =3D 0;
> #ifdef STRACE_GDB
>       av[i++] =3D "strace";
>       av[i++] =3D "-o";
>       av[i++] =3D "/tmp/strace.out";
> #ifdef __CYGWIN__
>       av[i++] =3D "--mask=3Dall+paranoid";
> #endif
> #endif
>       av[i++] =3D argv[1] ?: "gdb";
>       fprintf (stderr, "*** using %s\n", av[0]);
>       av[i++] =3D "-i=3Dmi";
>       av[i] =3D NULL;
>       execvp (av[0], (char * const *) av);
>       /* shouldn't get here */
>       exit (1);
>     }
>   /* parent */
>   const char *input[20];
>=20
>   int i =3D 0;
>   input[i++] =3D "1-inferior-tty-set /dev/pty3\n";
>   input[i++] =3D "2-gdb-set height 0\n";
>   input[i++] =3D "3-gdb-set non-stop 1\n";
>   input[i++] =3D "4-file-list-exec-source-files\n";
>   input[i++] =3D "5-file-list-exec-source-file\n";
>   input[i++] =3D "6-gdb-show prompt\n";
>   input[i++] =3D "7-stack-info-frame\n";
>   input[i++] =3D "8-thread-info\n";
>   input[i++] =3D "9-break-list\n";
>   input[i++] =3D "q\n";
>   input[i] =3D NULL;
>=20
>   for (int i =3D 0; input[i]; ++i)
>     {
>       write (master, input[i], strlen (input[i]));
>       // sleep (1);
>     }
>   get_output (master);
>   wait (NULL);
> }
>=20
> void
> get_output (int fd)
> {
>   char buf[4096];
>=20
>   while (1)
>     {
>       int nread =3D read (fd, buf, sizeof (buf));
>       if (nread > 0)
> 	write (STDOUT_FILENO, buf, nread);
>       else
> 	{
> 	  printf ("No more output.  nread %d\n", nread);
> 	  break;
> 	}
>     }
> }
>=20
>=20

> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--oj4kGyHlBMXGt3Le
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXTu6sAAoJEPU2Bp2uRE+g/SIQAICUu1dTiZycE/bAmowuB8EV
dl191B/+WrZ2b3I1mFapcYSNrdFT6n6tZGvru5D99TzsfQMXTXBWXKM+haWJYkq/
Vfza1y7hTxsWN3AmVCRF63VeD7Pc2Okdm4La72grZtKozHoetNEtnozE+Qh+cYMO
FjvadVHIC92CokgKbA1DPGkRn+jI6s3WEOcUY/OQtM2rLIIBTkO2GVjaehgh8o/z
NpYa6TvROViFyjv4yoJfmA9NU3+PrIT+bbkx4rUJkpPZmhB3JkE3j/NI/cQsI3C2
hk8oXry5jgzs3S0PlZm5aAWPN7yCLLPnFmuO46n1cL8IRRjpZxEUTNMj1YmEGlSc
rVEqPxzTOFVbgteY+myhE/urDbwjzcx+nrBvPg5mTTn1zgNMdo6QKulz0WeBBBXb
JmndqWVkunzu1PW0jwIf1fGjy67MHIlfYqqD/65VjWWG2Lqx6G0T3kMrQlkOvq6B
oLPc5DEe/yFrXFBk7W9S0OvfUb7i5XI5d4boIxOw8622cPVYVfXcWMN4HpVMfk2F
7eZy/oHj8DxNST+jkSEHPiRscyJPH8Vgy1mgjLz8Db4XxkGts0+Zuq129tbAoUpI
3YA1jge7/4f/ggL5M2wOqwRl7l5Xlor1hxxEPqt1/vQ6S6Pvg+DbropUYH9grnAa
vQWkJRXywauFZdhVL1ZG
=tfU3
-----END PGP SIGNATURE-----

--oj4kGyHlBMXGt3Le--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019