From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 03 18:31:04 2012 Received: (at submit) by debbugs.gnu.org; 3 Mar 2012 23:31:04 +0000 Received: from localhost ([127.0.0.1]:60421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3yPn-0002gs-SI for submit@debbugs.gnu.org; Sat, 03 Mar 2012 18:31:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60882) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3yPa-0002gW-EB for submit@debbugs.gnu.org; Sat, 03 Mar 2012 18:30:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3yOv-0005Qh-Py for submit@debbugs.gnu.org; Sat, 03 Mar 2012 18:30:11 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:42453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3yOv-0005Qc-NB for submit@debbugs.gnu.org; Sat, 03 Mar 2012 18:30:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55370) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3yOt-0002J1-Di for bug-gnu-emacs@gnu.org; Sat, 03 Mar 2012 18:30:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3yOq-0005Mp-E4 for bug-gnu-emacs@gnu.org; Sat, 03 Mar 2012 18:30:06 -0500 Received: from relay1.ptmail.sapo.pt ([212.55.154.21]:41987 helo=sapo.pt) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S3yOq-0005JB-0D for bug-gnu-emacs@gnu.org; Sat, 03 Mar 2012 18:30:04 -0500 Received: (qmail 28125 invoked from network); 3 Mar 2012 23:30:00 -0000 Received: from unknown (HELO sapo.pt) (10.134.37.165) by relay1 with SMTP; 3 Mar 2012 23:30:00 -0000 Received: (qmail 13557 invoked from network); 3 Mar 2012 23:30:01 -0000 X-AntiVirus: PTMail-AV 0.4-0.97.0 X-Scan-Status: AV clean (0.03773 seconds); AS clean (1.00881 seconds); Received: from unknown (HELO rolando-desktop) (finalyugi@sapo.pt@[78.137.237.152]) (envelope-sender ) by mta15 (qmail-ptmail-1.0.0) with AES128-SHA encrypted SMTP for ; 3 Mar 2012 23:29:59 -0000 From: Rolando Pereira To: bug-gnu-emacs@gnu.org Subject: 24.0.94; No output shown in *input/output* buffer of M-x gdb not working after first run Date: Sat, 03 Mar 2012 23:29:55 +0000 Message-ID: <87hay5tg98.fsf@sapo.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) Hello all, There seems to be a problem with M-x gdb in the lastest version of emacs (compiled from the bazaar repository). When I run M-x gdb on some file, I get a *gud-foo* buffer as expected. If I type "run" in that buffer, I get an additional buffer called *input/output of foo* where the program writes it's output and I can give inputs to it. So far, everything is working as expected. The bug appears after the program being debugged ends. If I try to run the same program from the *gud-foo* buffer (by typing "run" in it), the *input/output of foo* buffer no longer shows any output. However the buffer is still processing my input, because if I change the code so that it writes to a file, the values written to it are the values I type in the *input/output of foo* buffer. So only the output is affect by this bug. A couple of interesting notes: * If I quit (by typing "quit" at the *gud* buffer) and start a new one, the bug is still in effect, ie. not even the first "run" works correctly. This problem appears to happen because the *input/output* buffer isn't correctly killed. It might be related to bug #6962: GDB hangs ( http://comments.gmane.org/gmane.emacs.bugs/39877 ) because even after I quit gdb, M-x list-process still shows a "gdb-inferior" process running. If I kill the "gdb-inferior" that's left behind, for example, with the following code: (dolist (process (process-list)) (when (string=3D "gdb-inferior"=20 (substring (process-name process) 0 12)) (delete-process process))) I can start a new gdb and run the program once without any problems. * This bug is *not* present in Emacs 23.3.1 (the lastest non-emacs-24 I have installed). In that version, both M-x gdb and M-x gud-gdb work correctly. This is the C file I used as a test: --8<---------------cut here---------------start------------->8--- #include int main() { int foo =3D 0; int bar =3D 0; printf("foo: "); scanf("%d", &foo); printf("foo is: %d\n", foo); printf("bar: "); scanf("%d", &bar); printf("bar is: %d\n", bar); FILE *file =3D fopen("test.txt", "w"); fprintf(file, "foo: %d\nbar: %d", foo, bar); fclose(file); =09 return 0; } --8<---------------cut here---------------end--------------->8--- Here are the steps to reproduce the bug starting from "emacs -Q". 1. After opening emacs, open the file with the code (I'm going to assume it's called "main.c") 2. Compile it with M-x compile with the command "gcc -o main -g main.c". 3. Type M-x gdb with the command "gdb -i=3Dmi main". 4. In the *gud-main* buffer type "run". =20=20=20 5. In the *input/output of main* type "1" (without the quotes) in front of "foo: ". Press enter. 6. Type "2" (without the quotes) in front of "bar: ". Press enter. 7. Notice that there were no problems with the program execution. 8. Go to the *gud-main* buffer. Type "run" in it. 9. Notice that the string "foo: " no longer appears. Type "10" (without the quotes). 10. Notice that "bar: " also doesn't appear. Type "20" (without the quotes). 11. Notice that the program ended (the *gud-main* shows [existed-normally]). 12. Open the "test.txt" file. It should have the following content: foo: 10 bar: 20 In GNU Emacs 24.0.94.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2012-03-03 on rolando-desktop Windowing system distributor `The X.Org Foundation', version 11.0.10706000 Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: pt_PT.utf8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Debugger Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: o m p i l e g=20 + + c c SPC - o SPC m a i n=20 SPC - g SPC m a i n . c M-x g d b =20 r 3 5 C-x o 3 5 6 =20 1 3 C-x o=20 r C-x o 3 5 2 =20 =20 =20 =20 =20 =20 =20 =20 3 5 2 3 2 =20 C-x o y y y =20 y e s n y y =20 y y y y y =20 y y y y n =20 C-x k t y=20 e s C-x o C-x k M-x l i s t - p r=20 o c e s s C-x o C-x b M-x g d b =20 r C-x o 5 2 3 C-x=20 o r C-x o 3 5 2 3 5 C-x=20 o q u i t y e s M-x l i s t - p r=20 o c e s s C-x o M-x e m a =20 r e p o r t - C-g M-x g=20 d b r r C-x k =20 y e s y e s C-x o M-x =20 r M-x r e p o r Recent messages: Command: -exec-interrupt Now in non-stop/A mode. Defining kbd macro... New macro counter value: 1 (1) Keyboard macro defined Quit Nenhum arquivo execut=C3=A1vel especificado. Utilize o comando "file" ou "exec-file". Nenhum arquivo execut=C3=A1vel especificado. Utilize o comando "file" ou "exec-file". Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tabulated-list kmacro gdb-mi bindat json gud easy-mmode shell pcomplete compile comint ansi-color ring cc-mode cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 04 19:11:02 2012 Received: (at 10933) by debbugs.gnu.org; 5 Mar 2012 00:11:02 +0000 Received: from localhost ([127.0.0.1]:33106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S4LW1-0005hd-IW for submit@debbugs.gnu.org; Sun, 04 Mar 2012 19:11:01 -0500 Received: from relay2.ptmail.sapo.pt ([212.55.154.22]:42906 helo=sapo.pt) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1S4LVo-0005hA-Ox for 10933@debbugs.gnu.org; Sun, 04 Mar 2012 19:10:50 -0500 Received: (qmail 25290 invoked from network); 5 Mar 2012 00:10:02 -0000 Received: from unknown (HELO sapo.pt) (10.134.37.164) by relay2 with SMTP; 5 Mar 2012 00:10:02 -0000 Received: (qmail 30893 invoked from network); 5 Mar 2012 00:10:01 -0000 X-AntiVirus: PTMail-AV 0.4-0.97.0 X-Scan-Status: AV clean (0.01590 seconds); AS clean (0.13618 seconds); Received: from unknown (HELO rolando-desktop) (finalyugi@sapo.pt@[46.189.170.190]) (envelope-sender ) by mta14 (qmail-ptmail-1.0.0) with AES128-SHA encrypted SMTP for <10933@debbugs.gnu.org>; 5 Mar 2012 00:10:01 -0000 From: Rolando Pereira To: 10933@debbugs.gnu.org Subject: Re: bug#10933: Acknowledgement (24.0.94; No output shown in *input/output* buffer of M-x gdb not working after first run) References: <87hay5tg98.fsf@sapo.pt> Date: Mon, 05 Mar 2012 00:09:55 +0000 In-Reply-To: (GNU bug Tracking System's message of "Sat, 03 Mar 2012 23:32:01 +0000") Message-ID: <87zkbvq564.fsf@fe.up.pt> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: 10933 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) Just a little more information about the bug that I gathered today: 1. Ending the execution of the program being debugged by calling `gdb-io-interrupt' (C-c C-c) when the cursor is in front of the "foo: " or "bar: " prompts stops the bug from occuring. 2. The same thing happens when you call `comint-interrupt-subjob' in the *gud-main* buffer. 3. If I start gdb with M-x gud-gdb, everything works fine (I thought the gud-gdb wasn't part of emacs 24, so I hadn't tested it). I forgot to mention in the first email that I'm running gdb 7.4, but the bug also happens with gdb 7.2 From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 10 04:53:02 2012 Received: (at control) by debbugs.gnu.org; 10 Mar 2012 09:53:02 +0000 Received: from localhost ([127.0.0.1]:41927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6Iz0-0008Bn-A1 for submit@debbugs.gnu.org; Sat, 10 Mar 2012 04:53:02 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:48101) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S6Iyx-0008BW-PB for control@debbugs.gnu.org; Sat, 10 Mar 2012 04:53:00 -0500 Received: from bb116-14-103-36.singnet.com.sg ([116.14.103.36]:55739 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1S6IWG-0004FC-C2 for control@debbugs.gnu.org; Sat, 10 Mar 2012 04:23:21 -0500 From: Chong Yidong To: control@debbugs.gnu.org Subject: severity 10933 important Date: Sat, 10 Mar 2012 17:23:13 +0800 Message-ID: <87k42sn726.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) severity 10933 important thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 22 12:45:59 2012 Received: (at 10933) by debbugs.gnu.org; 22 Mar 2012 16:45:59 +0000 Received: from localhost ([127.0.0.1]:33398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SAl9C-0002x7-MN for submit@debbugs.gnu.org; Thu, 22 Mar 2012 12:45:59 -0400 Received: from mail-yw0-f44.google.com ([209.85.213.44]:35950) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SAepb-0000jR-Dc for 10933@debbugs.gnu.org; Thu, 22 Mar 2012 06:01:38 -0400 Received: by yhkk25 with SMTP id k25so1539941yhk.3 for <10933@debbugs.gnu.org>; Thu, 22 Mar 2012 02:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=4qatdIXuDsVXDFiIQ1X9EUGvyrlbdQQCqGJzmQSSgiA=; b=ISf/4vsTgjH86Pz+N2z3IOCb2vC69hjFBYQZYlV1uowwXqL1X5gFrBKYAS8QpZlh7C DLFtIqrUvgSAOu+a826Qga8DwF3JNsFdUD9QnvCVlXeIU14e7N4kFN+vvLqb40leWroy Lu3cAqohYwnOrhk3+u3cJlmKGDEGGFBY/MvjvrPt+3pfTJis9d0evta5rpSgHbXJr3Mf l1P6fwH0+GM4/WWXUa9xw3DzckXhXfOhEGGRpF+8xoZJqxF0bmCT3HqwGqNHA27ffFit wilRMV3XaWmcR187tQsR9WiwOpGBm8e1IRrAHVFoywo6CMcwJTUXaxPJYMf/0oqgO7CK MTGg== MIME-Version: 1.0 Received: by 10.236.136.33 with SMTP id v21mr7334751yhi.17.1332408632558; Thu, 22 Mar 2012 02:30:32 -0700 (PDT) Received: by 10.236.25.39 with HTTP; Thu, 22 Mar 2012 02:30:32 -0700 (PDT) In-Reply-To: <87zkbvq564.fsf@fe.up.pt> References: <87hay5tg98.fsf@sapo.pt> <87zkbvq564.fsf@fe.up.pt> Date: Thu, 22 Mar 2012 10:30:32 +0100 Message-ID: Subject: Re: bug#10933: Acknowledgement (24.0.94; No output shown in *input/output* buffer of M-x gdb not working after first run) From: Troels Nielsen To: Rolando Pereira Content-Type: multipart/mixed; boundary=20cf303dd2fc3d45ac04bbd18f04 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10933 X-Mailman-Approved-At: Thu, 22 Mar 2012 12:45:56 -0400 Cc: 10933@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) --20cf303dd2fc3d45ac04bbd18f04 Content-Type: text/plain; charset=ISO-8859-1 Hi, I think this bug is due to gdb-mi creating a pty which it expects to remain open. When the process being debugged disconnects, emacs will receive an EIO-errno and (I believe mistakenly) send a SIGCHLD to itself, and stop listening to the pty. This patch fixes the problem for me. Troels --20cf303dd2fc3d45ac04bbd18f04 Content-Type: text/x-patch; charset=US-ASCII; name="gdb-fix.patch" Content-Disposition: attachment; filename="gdb-fix.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h03lm2tw0 PT09IG1vZGlmaWVkIGZpbGUgJ3NyYy9wcm9jZXNzLmMnCi0tLSBzcmMvcHJvY2Vzcy5jCTIwMTIt MDEtMjEgMTA6NTQ6MTkgKzAwMDAKKysrIHNyYy9wcm9jZXNzLmMJMjAxMi0wMy0yMSAyMjoxNjow MiArMDAwMApAQCAtNDg4OCwxMSArNDg4OCwxNCBAQAogCQkgSXQgY2FuJ3QgaHVydC4gICovCiAJ ICAgICAgZWxzZSBpZiAobnJlYWQgPT0gLTEgJiYgZXJybm8gPT0gRUlPKQogCQl7Ci0JCSAgLyog Q2xlYXIgdGhlIGRlc2NyaXB0b3Igbm93LCBzbyB3ZSBvbmx5IHJhaXNlIHRoZSBzaWduYWwgb25j ZS4gICovCi0JCSAgRkRfQ0xSIChjaGFubmVsLCAmaW5wdXRfd2FpdF9tYXNrKTsKLQkJICBGRF9D TFIgKGNoYW5uZWwsICZub25fa2V5Ym9hcmRfd2FpdF9tYXNrKTsKLQotCQkgIGtpbGwgKGdldHBp ZCAoKSwgU0lHQ0hMRCk7CisgICAgICAgICAgICAgICAgICAvKiBEb24ndCBkbyBhbnl0aGluZyBp ZiBvbmx5IGEgcHR5LCB3aXRoIG5vIGFzc29jaWF0ZWQgcHJvY2VzcyAqLworICAgICAgICAgICAg ICAgICAgaWYgKFhQUk9DRVNTKHByb2MpLT5waWQgIT0gLTIpIHsgCisgICAgICAgICAgICAgICAg ICAgIC8qIENsZWFyIHRoZSBkZXNjcmlwdG9yIG5vdywgc28gd2Ugb25seSByYWlzZSB0aGUgc2ln bmFsIG9uY2UuICAqLworICAgICAgICAgICAgICAgICAgICBGRF9DTFIgKGNoYW5uZWwsICZpbnB1 dF93YWl0X21hc2spOworICAgICAgICAgICAgICAgICAgICBGRF9DTFIgKGNoYW5uZWwsICZub25f a2V5Ym9hcmRfd2FpdF9tYXNrKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAg ICAgICAgIGtpbGwgKGdldHBpZCAoKSwgU0lHQ0hMRCk7CisgICAgICAgICAgICAgICAgICB9CiAJ CX0KICNlbmRpZiAvKiBIQVZFX1BUWVMgKi8KIAkgICAgICAvKiBJZiB3ZSBjYW4gZGV0ZWN0IHBy b2Nlc3MgdGVybWluYXRpb24sIGRvbid0IGNvbnNpZGVyIHRoZSBwcm9jZXNzCgo= --20cf303dd2fc3d45ac04bbd18f04-- From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 23 08:58:23 2012 Received: (at 10933-done) by debbugs.gnu.org; 23 Mar 2012 12:58:23 +0000 Received: from localhost ([127.0.0.1]:34919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SB44U-00088Q-P0 for submit@debbugs.gnu.org; Fri, 23 Mar 2012 08:58:23 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183]:27097) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SB44S-00088J-FM for 10933-done@debbugs.gnu.org; Fri, 23 Mar 2012 08:58:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AicFAKU/KE9FpYqr/2dsb2JhbACBX5x7eYhwnhmGGQSbGYQJ X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="169641480" Received: from 69-165-138-171.dsl.teksavvy.com (HELO pastel.home) ([69.165.138.171]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 23 Mar 2012 08:27:27 -0400 Received: by pastel.home (Postfix, from userid 20848) id A363358EA2; Fri, 23 Mar 2012 08:27:26 -0400 (EDT) From: Stefan Monnier To: Troels Nielsen Subject: Re: bug#10933: Acknowledgement (24.0.94; No output shown in *input/output* buffer of M-x gdb not working after first run) Message-ID: References: <87hay5tg98.fsf@sapo.pt> <87zkbvq564.fsf@fe.up.pt> Date: Fri, 23 Mar 2012 08:27:26 -0400 In-Reply-To: (Troels Nielsen's message of "Thu, 22 Mar 2012 10:30:32 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10933-done Cc: Rolando Pereira , 10933-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > I think this bug is due to gdb-mi creating a pty which it expects to > remain open. When the process being debugged disconnects, emacs will > receive an EIO-errno and (I believe mistakenly) send a SIGCHLD to > itself, and stop listening to the pty. > This patch fixes the problem for me. Thanks, I don't understand what is special about gdb-mi that it's the only one to trigger this problem, and I suspect there's a slightly cleaner fix (as the above comment mentions, we only send ourselves a SIGCHLD to work around problems we don't understand in some undescribed situations, which may even be situations that don't exist any more nowadays for all I know). But I installed the patch anyway, with minor coding-convention cleanups (wrap at 80 columns, space before open-paren). Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Mar 23 09:20:50 2012 Received: (at 10933-done) by debbugs.gnu.org; 23 Mar 2012 13:20:50 +0000 Received: from localhost ([127.0.0.1]:35013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SB4QA-0000IP-Oy for submit@debbugs.gnu.org; Fri, 23 Mar 2012 09:20:49 -0400 Received: from mail-ee0-f44.google.com ([74.125.83.44]:39854) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SB4Q7-0000IH-Me for 10933-done@debbugs.gnu.org; Fri, 23 Mar 2012 09:20:45 -0400 Received: by eeke51 with SMTP id e51so1085035eek.3 for <10933-done@debbugs.gnu.org>; Fri, 23 Mar 2012 05:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:content-type:content-transfer-encoding:message-id:date :from:to:cc:subject:in-reply-to:references:x-mailer; bh=wtpMsicCcHiumeFmLk/7PpBHVcp1KZfLWDN4zutB1jw=; b=lkJRJ57PYgUp8whtc5WJD83dKGqCwTmjjYO2xOZSP63XP6jfsV83FhfQ5/Dni+nW84 9WP3wfpRJ/UKShuPdiQnSCmjX0C9fCcIbZxnhTD6kgclYgnXAnMGh0vdMeOiQGuCFQVM nHy5bQNsnAjqiCIy233BLyTIgkhKadvU4WkpNCHsKxWUxfT2eV5s2sq7PGf3eirCWTzF V52wgMzTtstAwwcYW7Kx9G2CQdWwpJK5IBSdRzq6sPiak44IKxgG97pOYgc/rnmewDG9 IQlqKc2d+vDcIPqlrViakqgOYoKo1yon43se+7G/Bqm9dN84nKVXI/TCgKJVK2LbBPb4 rpbA== Received: by 10.14.127.139 with SMTP id d11mr1698172eei.74.1332506990101; Fri, 23 Mar 2012 05:49:50 -0700 (PDT) Received: from polaris.localdomain (fw01.int.konstellation.dk. [77.66.4.173]) by mx.google.com with ESMTPS id z47sm27865598een.5.2012.03.23.05.49.48 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Mar 2012 05:49:49 -0700 (PDT) Received: by polaris.localdomain (Postfix, from userid 1000) id 40A81240136; Fri, 23 Mar 2012 13:50:13 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20332.29060.866781.56217@gargle.gargle.HOWL> Date: Fri, 23 Mar 2012 13:50:12 +0100 From: Troels Nielsen To: Stefan Monnier Subject: Re: bug#10933: Acknowledgement (24.0.94; No output shown in *input/output* buffer of M-x gdb not working after first run) In-Reply-To: References: <87hay5tg98.fsf@sapo.pt> <87zkbvq564.fsf@fe.up.pt> X-Mailer: VM 8.2.0b under 24.0.94.31 (x86_64-unknown-linux-gnu) X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10933-done Cc: Rolando Pereira , 10933-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Stefan Monnier writes: > > I think this bug is due to gdb-mi creating a pty which it expects to > > remain open. When the process being debugged disconnects, emacs will > > receive an EIO-errno and (I believe mistakenly) send a SIGCHLD to > > itself, and stop listening to the pty. > > > This patch fixes the problem for me. > Thanks, I don't understand what is special about gdb-mi that it's > the only one to trigger this problem, and I suspect there's a > slightly cleaner fix (as the above comment mentions, we only send > ourselves a SIGCHLD to work around problems we don't understand in > some undescribed situations, which may even be situations that > don't exist any more nowadays for all I know). I think the problems mentioned in the comments are due to SIGCHLD sometimes getting lost on certain unices, when two children or more exit (or maybe generally when many signals are sent) simultaneously. I believe (but may be mistaken :) ) that it is only relevant when emacs itself is responsible for parenting the process. In this case however gdb-mi is only creating a pty (using create_pty in process.c), which gdb is instructed to connect the debugged process to. So gdb is the parent and emacs should probably not care too much if the debugged process dies. Troels From unknown Thu Sep 11 20:11:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 21 Apr 2012 11:24:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator