From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Johan Euphrosine Newsgroups: gmane.emacs.bugs Subject: bug#4975: 23.1; comint.el: command line is sometimes echoed in the command output Date: Thu, 19 Nov 2009 17:40:05 +0100 Message-ID: <1258648805.4446.1.camel@pasokon> Reply-To: Johan Euphrosine , 4975@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-sCpgMbXSL5d03v4SxwVj" X-Trace: ger.gmane.org 1258727973 18494 80.91.229.12 (20 Nov 2009 14:39:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2009 14:39:33 +0000 (UTC) Cc: Cyril Bouthors , Olin Shivers , Simon Marshall To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 20 15:39:20 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NBUdr-0007ap-6R for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Nov 2009 15:39:20 +0100 Original-Received: from localhost ([127.0.0.1]:53292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBUdq-0002I4-LJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 20 Nov 2009 09:39:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBAAO-0004yH-25 for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:47:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBAAH-0004nX-Py for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:47:30 -0500 Original-Received: from [199.232.76.173] (port=52167 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBAAH-0004mq-6s for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:47:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:36166) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NBAAG-0002lr-Iv for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:47:24 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJGlKBK018128; Thu, 19 Nov 2009 08:47:21 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAJGj4uJ017813; Thu, 19 Nov 2009 08:45:04 -0800 Resent-Date: Thu, 19 Nov 2009 08:45:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Johan Euphrosine Original-Sender: Johan Euphrosine Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 19 Nov 2009 16:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4975 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125864882617706 (code B ref -1); Thu, 19 Nov 2009 16:45:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 19 Nov 2009 16:40:26 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAJGeNap017703 for ; Thu, 19 Nov 2009 08:40:24 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NBA3T-0005l3-4T for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:40:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NBA3S-0005kB-5A for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:40:22 -0500 Original-Received: from [199.232.76.173] (port=33703 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NBA3R-0005k4-W5 for bug-gnu-emacs@gnu.org; Thu, 19 Nov 2009 11:40:22 -0500 Original-Received: from ey-out-1920.google.com ([74.125.78.147]:28914) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NBA3M-0001Ph-PE; Thu, 19 Nov 2009 11:40:17 -0500 Original-Received: by ey-out-1920.google.com with SMTP id 26so102715eyw.2 for ; Thu, 19 Nov 2009 08:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer; bh=n0ZwIjlfCk+og60JWsDdJVv3OlAjy9UzHAufpWeBXJ0=; b=faewAST6txJJdj1DsG8qgFDjBws5PnYl9AjMxtaym6CwMHJvGUor7Cv3hXesjtQs8X uH9+rWwWSNvPwaScS1pCHvthsC4B3rtTThBsQz7LxOC6549WGxTFrKqo9H7VYxqPZ+NW uX5NZSr8Nxj71BiVylPDIBYnSy7tqeIJzBOi0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer; b=jIW6c5Hy8HnJs15B68CP9V+Qf4Gaq7P1Zj55a02tPlF/zKfUcRAGrd3iZGByKRChSU 7in13SBJzV15lnio9E9glDvFmcVdZQrFlUQvhxlU5zv+FM/mBu6z6w/VYsYQLBqTDDBZ d2AvX3Hvfi3W0xEOHvJEeS3tVT0XcoNlE2eUA= Original-Received: by 10.213.107.17 with SMTP id z17mr224448ebo.10.1258648813388; Thu, 19 Nov 2009 08:40:13 -0800 (PST) Original-Received: from ?192.168.5.33? ([88.171.43.213]) by mx.google.com with ESMTPS id 13sm299623ewy.9.2009.11.19.08.40.11 (version=SSLv3 cipher=RC4-MD5); Thu, 19 Nov 2009 08:40:12 -0800 (PST) X-Mailer: Evolution 2.28.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 19 Nov 2009 11:47:30 -0500 X-Mailman-Approved-At: Fri, 20 Nov 2009 09:37:31 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32766 Archived-At: --=-sCpgMbXSL5d03v4SxwVj Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I managed to reproduce http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D284727 with comint-mode, and emacs23: After running php -r 'fwrite(STDOUT, "stdout\n");' in a bash comint buffer: every command is echoed twice. emacs M-x comint-run /bin/bash proppy@pasokon:~$ echo 'command is echoed once' command is echoed once proppy@pasokon:~$ php -r 'fwrite(STDOUT, "stdout\n");' stdout proppy@pasokon:~$ php -r 'fwrite(STDOUT, "stdout\n");' php -r 'fwrite(STDOUT, "stdout\n");' stdout proppy@pasokon:~$ echo 'command is echoed twice' echo 'command is echoed twice' command is echoed twice I found out that setting 'comint-process-echoes to 't' workaround this issue: emacs (setq comint-process-echoes t) M-x comint-run /bin/bash proppy@pasokon:~$ echo 'command is echoed once' command is echoed once proppy@pasokon:~$ php -r 'fwrite(STDOUT, "stdout\n");' stdout proppy@pasokon:~$ php -r 'fwrite(STDOUT, "stdout\n");' stdout proppy@pasokon:~$ echo 'command is *not* echoed twice' command is *not* echoed twice I ran strace on php -r 'fwrite(STDOUT, "stdout\n");' to find out if there is something strange done with the file descriptors, that might bother comint-mode: fstat64(0, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 fstat64(0, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 fstat64(0, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0xb7720000 _llseek(0, 0, 0xbffad494, SEEK_CUR) =3D -1 ESPIPE (Illegal seek) fstat64(1, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 fstat64(1, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 fstat64(1, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =3D 0xb771f000 _llseek(1, 0, 0xbffad494, SEEK_CUR) =3D -1 ESPIPE (Illegal seek) fstat64(2, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 fstat64(2, {st_mode=3DS_IFCHR|0620, st_rdev=3Dmakedev(136, 0), ...}) =3D 0 _llseek(2, 0, 0xbffad494, SEEK_CUR) =3D -1 ESPIPE (Illegal seek) write(1, "stdout\n", 7stdout ) =3D 7 close(2) =3D 0 close(1) =3D 0 munmap(0xb771f000, 4096) =3D 0 close(0) =3D 0 munmap(0xb7720000, 4096) =3D 0 open("/dev/urandom", O_RDONLY) =3D 0 read(0, "\362\233\264#", 4) =3D 4 close(0) =3D 0 open("/dev/urandom", O_RDONLY) =3D 0 read(0, "\314R}\32", 4) =3D 4 close(0) =3D 0 open("/dev/urandom", O_RDONLY) =3D 0 read(0, "=3D\247\332f", 4) =3D 4 close(0) =3D 0 setitimer(ITIMER_PROF, {it_interval=3D{0, 0}, it_value=3D{0, 0}}, NULL) =3D= 0 munmap(0x3c4000, 29352) =3D 0 munmap(0xea9000, 89020) =3D 0 gettimeofday({1258647750, 866613}, NULL) =3D 0 munmap(0x3aa000, 105232) =3D 0 munmap(0x39e000, 47616) =3D 0 munmap(0xfd9000, 2054564) =3D 0 exit_group(0) =3D ? but when trying to mimic this behaviour with a simple c program: #include #include int main() { int a; llseek(0, 0, 0, SEEK_CUR); llseek(1, 0, 0, SEEK_CUR); llseek(2, 0, 0, SEEK_CUR); write(1, "stdout\n", 7); close(2); close(1); close(0); open("/dev/urandom", O_RDONLY); read(0, "\34\256\nY", 4); close(0); open("/dev/urandom", O_RDONLY); read(0, "\34\256\nY", 4); close(0); open("/dev/urandom", O_RDONLY); read(0, "\34\256\nY", 4); close(0); return 0; } _llseek(0, 0, 0xbfd27570, SEEK_CUR) =3D -1 ESPIPE (Illegal seek) _llseek(1, 0, 0xbfd27570, SEEK_CUR) =3D -1 ESPIPE (Illegal seek) _llseek(2, 0, 0xbfd27570, SEEK_CUR) =3D -1 ESPIPE (Illegal seek) write(1, "stdout\n", 7stdout ) =3D 7 close(2) =3D 0 close(1) =3D 0 close(0) =3D 0 open("/dev/urandom", O_RDONLY) =3D 0 read(0, 0x8048705, 4) =3D -1 EFAULT (Bad address) close(0) =3D 0 open("/dev/urandom", O_RDONLY) =3D 0 read(0, 0x8048705, 4) =3D -1 EFAULT (Bad address) close(0) =3D 0 open("/dev/urandom", O_RDONLY) =3D 0 read(0, 0x8048705, 4) =3D -1 EFAULT (Bad address) close(0) =3D 0 exit_group(0) =3D ? It do not trigger the issue in comint: emacs M-x comint-run /bin/bash proppy@pasokon:~$ echo 'command is echoed once' command is echoed once proppy@pasokon:~$ /tmp/a stdout proppy@pasokon:~$ echo 'command is *not* echoed twice' command is *not* echoed twice proppy@pasokon:~$ php -r 'fwrite(STDOUT, "stdout\n");' stdout proppy@pasokon:~$ echo 'command is echoed twice' echo 'command is echoed twice' command is echoed twice proppy@pasokon:~$=20 Do you have suggestion on how to debug this issue further ? Let me know if you need more information. Thanks in advance. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /usr/share/emacs/23.1/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.3) of 2009-11-10 on vernadsky, modified by Debian Windowing system distributor `The X.Org Foundation', version 11.0.10604000 configured using `configure '--build=3Di486-linux-gnu' '--host=3Di486-linux-gnu' '--prefix=3D/usr' '--sharedstatedir=3D/var/lib' '--libexecdir=3D/usr/lib' '--localstatedir=3D/var/lib' '--infodir=3D/usr/share/info' '--mandir=3D/usr/share/man' '--with-pop=3Dyes= ' '--enable-locallisppath=3D/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23= .1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-li= sp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=3Dyes' = '--with-x-toolkit=3Dgtk' '--with-toolkit-scroll-bars' 'build_alias=3Di486-l= inux-gnu' 'host_alias=3Di486-linux-gnu' 'CFLAGS=3D-DDEBIAN -g -O2' 'LDFLAGS= =3D-g' 'CPPFLAGS=3D'' 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: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: rcirc-track-minor-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-p M-p M-p M-p M-p M-p M-n M-n =20 C-x b =20 0 , SPC 0 , SPC =20 0 , SPC C-x C-s M-x c o m p i=20 l e C-x b M-> M-p M-p =20 C-x 1 C-x b =20 M-d M-d 0 M-d=20 M-d 0 M-d M-d 0 C-x C-s M-x c o m p i=20 l e C-x b M-> M-p =20 C-x 1 M-> l s =20 C-x k M-x M-p M-p C-a C-g C-g M-x s h e l=20 l M-p=20 M-p l s l s l s SPC - a=20 l C-x 1 =20 C-x b C-x b c o M-< =20 =20 =20 M-x r e p o t r=20 t c o m i n t SPC C-x o C-s p r o c=20 e s C-x o C-x b C-g C-x b b u M-< =20 =20 =20 =20 M-f M-f C-x b M-x M-p M-p C-g C-g C-x=20 b M-f C-SPC C-e=20 M-w M-w C-x b M-x c o m i C-g=20 M-x r e p o t - =20 r t - e Recent messages: call-interactively: Beginning of buffer Making completion list... read-buffer-to-switch: Command attempted to use minibuffer while in minibuffer Quit [2 times] Mark set Quit [2 times] Mark set Making completion list... Quit Making completion list... --=20 Johan Euphrosine Development and services around Free Software http://aminche.com/ --=-sCpgMbXSL5d03v4SxwVj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAksFdNkACgkQZmEdV9SHoe7PkgCbBe+SJ3GZBKncosDGJcTK12df VcEAn2PdILg3jwLnRFQF1RTUhSu7zRLu =XeoM -----END PGP SIGNATURE----- --=-sCpgMbXSL5d03v4SxwVj--