From proppy@gmail.com Thu Nov 19 08:40:25 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 19 Nov 2009 16:40:26 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.9 required=4.0 tests=FOURLA,IMPRONONCABLE_2, PGPSIGNATURE autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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 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 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 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 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 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= Received: by 10.213.107.17 with SMTP id z17mr224448ebo.10.1258648813388; Thu, 19 Nov 2009 08:40:13 -0800 (PST) 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) Sender: Johan Euphrosine Subject: 23.1; comint.el: command line is sometimes echoed in the command output From: Johan Euphrosine To: bug-gnu-emacs@gnu.org Cc: Olin Shivers , Simon Marshall , Cyril Bouthors Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-sCpgMbXSL5d03v4SxwVj" Date: Thu, 19 Nov 2009 17:40:05 +0100 Message-ID: <1258648805.4446.1.camel@pasokon> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) --=-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-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 14 00:20:26 2016 Received: (at 4975) by debbugs.gnu.org; 14 Jul 2016 04:20:26 +0000 Received: from localhost ([127.0.0.1]:50419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNY8Q-0007tL-3H for submit@debbugs.gnu.org; Thu, 14 Jul 2016 00:20:26 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:32868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNY8O-0007t9-BC for 4975@debbugs.gnu.org; Thu, 14 Jul 2016 00:20:24 -0400 Received: by mail-qk0-f170.google.com with SMTP id p74so63142460qka.0 for <4975@debbugs.gnu.org>; Wed, 13 Jul 2016 21:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=9Q+d6e+OALqHZM41iPvc4Z0ysuoNmF/Dmy9cBqv+Zd0=; b=zcXFVxBkz0gI2NQDVDJOOmkFxW9ZQQVvBt2AYj6NhJ0u+CsDHnML/pW+KduzHJEqBL hrChsVUq1Ao3ri+oESvj+pE485bQ7SMLhGLifdp7E60gINHPCbqDbp/4N04fxJbB3oO1 O4mGLSE7sG8x2aE+45VkONPuk/3h0wJK+Xck/yQMeFp2dvehAdOwwmOcZpOIs7J9Keii +L9KudaSnVcSv8GC9aXf4TZy+0TtBbXVx5BuDfASFdlTekzuJvXSP3YDyZJQy9LhzfIl XcdvOcylqPgocRLPBFYO/MNuzNjzqT2aZSsKJtXfLtSNOWP9jj0WAXhZqiBQJTtIrhkA XIqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=9Q+d6e+OALqHZM41iPvc4Z0ysuoNmF/Dmy9cBqv+Zd0=; b=cZF6AVmRDoP694uWsaB4PbPoq590YHeOcY0y+erQP+dL3ofM7oxKN9AcL//51ZhwMT HN2hcY097l7f1xBcQDwIDQhw6cZLzmKnKSqaAea+uBLDinPqRW8CCALScd8yV7AEhWdo +jY9YkPZlvnRKm6wBGVcSdMxGZm2B04USltlFbm/Gz4pfCWOLzC256NhuruGXjXXeCAR NlPNs+8iSUuwbya+SLOAzsr3ACTSFR0tgpXsgPOInJGZArZPIGjuxqEriS3hMVhj0YAB 2VJzAX9tYB740VSKSpJD1CEn5udtDddpP6ty0Qh6co0x2fsOJHYbJMWNAmweaRQ8BI37 a8LA== X-Gm-Message-State: ALyK8tK5FnpLacATSNQeWRpU6/g/xOkISJvq1AJ/wnydISCXmHSRLimH83WhWuVfdJ8ATA== X-Received: by 10.55.54.3 with SMTP id d3mr14388520qka.16.1468470018951; Wed, 13 Jul 2016 21:20:18 -0700 (PDT) Received: from Andrews-MacBook-Pro.local (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id c15sm199135qkg.46.2016.07.13.21.20.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jul 2016 21:20:17 -0700 (PDT) From: Andrew Hyatt To: Johan Euphrosine Subject: Re: bug#4975: 23.1; comint.el: command line is sometimes echoed in the command output References: <1258648805.4446.1.camel@pasokon> Date: Thu, 14 Jul 2016 00:20:16 -0400 In-Reply-To: <1258648805.4446.1.camel@pasokon> (Johan Euphrosine's message of "Thu, 19 Nov 2009 17:40:05 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 4975 Cc: Cyril Bouthors , 4975@debbugs.gnu.org, Olin Shivers , Simon Marshall X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Hi Johan - I can't reproduce this on Emacs 25. Here's what I got: bash-3.2$ echo 'command is echoed once' command is echoed once bash-3.2$ php -r 'fwrite(STDOUT, "stdout\n");' stdout bash-3.2$ php -r 'fwrite(STDOUT, "stdout\n");' stdout bash-3.2$ echo 'command is echoed twice' command is echoed twice Let me know if you (or anyone else) can still reproduce this, otherwise I'll close this in a few weeks. Johan Euphrosine writes: > Hi, > > I managed to reproduce > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=284727 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=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > fstat64(0, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, > 0) = 0xb7720000 > _llseek(0, 0, 0xbffad494, SEEK_CUR) = -1 ESPIPE (Illegal seek) > fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, > 0) = 0xb771f000 > _llseek(1, 0, 0xbffad494, SEEK_CUR) = -1 ESPIPE (Illegal seek) > fstat64(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > fstat64(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 > _llseek(2, 0, 0xbffad494, SEEK_CUR) = -1 ESPIPE (Illegal seek) > write(1, "stdout\n", 7stdout > ) = 7 > close(2) = 0 > close(1) = 0 > munmap(0xb771f000, 4096) = 0 > close(0) = 0 > munmap(0xb7720000, 4096) = 0 > open("/dev/urandom", O_RDONLY) = 0 > read(0, "\362\233\264#", 4) = 4 > close(0) = 0 > open("/dev/urandom", O_RDONLY) = 0 > read(0, "\314R}\32", 4) = 4 > close(0) = 0 > open("/dev/urandom", O_RDONLY) = 0 > read(0, "=\247\332f", 4) = 4 > close(0) = 0 > setitimer(ITIMER_PROF, {it_interval={0, 0}, it_value={0, 0}}, NULL) = 0 > munmap(0x3c4000, 29352) = 0 > munmap(0xea9000, 89020) = 0 > gettimeofday({1258647750, 866613}, NULL) = 0 > munmap(0x3aa000, 105232) = 0 > munmap(0x39e000, 47616) = 0 > munmap(0xfd9000, 2054564) = 0 > exit_group(0) = ? > > 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) = -1 ESPIPE (Illegal seek) > _llseek(1, 0, 0xbfd27570, SEEK_CUR) = -1 ESPIPE (Illegal seek) > _llseek(2, 0, 0xbfd27570, SEEK_CUR) = -1 ESPIPE (Illegal seek) > write(1, "stdout\n", 7stdout > ) = 7 > close(2) = 0 > close(1) = 0 > close(0) = 0 > open("/dev/urandom", O_RDONLY) = 0 > read(0, 0x8048705, 4) = -1 EFAULT (Bad address) > close(0) = 0 > open("/dev/urandom", O_RDONLY) = 0 > read(0, 0x8048705, 4) = -1 EFAULT (Bad address) > close(0) = 0 > open("/dev/urandom", O_RDONLY) = 0 > read(0, 0x8048705, 4) = -1 EFAULT (Bad address) > close(0) = 0 > exit_group(0) = ? > > 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:~$ > > 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=i486-linux-gnu' > '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' > '--libexecdir=/usr/lib' '--localstatedir=/var/lib' > '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' > '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' > > 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 > C-x b > 0 , SPC 0 , SPC > 0 , SPC C-x C-s M-x c o m p i > l e C-x b M-> M-p M-p > C-x 1 C-x b > M-d M-d 0 M-d > M-d 0 M-d M-d 0 C-x C-s M-x c o m p i > l e C-x b M-> M-p > C-x 1 M-> l s > C-x k M-x M-p M-p C-a C-g C-g M-x s h e l > l M-p > M-p l s l s l s SPC - a > l C-x 1 > C-x b C-x b c o M-< > > > M-x r e p o t r > t c o m i n t SPC C-x o C-s p r o c > e s C-x o C-x b C-g C-x b b u M-< > > > > M-f M-f C-x b M-x M-p M-p C-g C-g C-x > b M-f C-SPC C-e > M-w M-w C-x b M-x c o m i C-g > M-x r e p o t - > 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... From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 14 11:37:09 2016 Received: (at 4975) by debbugs.gnu.org; 14 Jul 2016 15:37:09 +0000 Received: from localhost ([127.0.0.1]:51606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNihJ-00046X-4P for submit@debbugs.gnu.org; Thu, 14 Jul 2016 11:37:09 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNZrn-0002Qq-VP for 4975@debbugs.gnu.org; Thu, 14 Jul 2016 02:11:24 -0400 Received: by mail-lf0-f49.google.com with SMTP id h129so54598195lfh.1 for <4975@debbugs.gnu.org>; Wed, 13 Jul 2016 23:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isvtec.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=njg1nMF5A340qksp/XspDp5K0OrvuYfQ3dvK8BBJwgw=; b=Y+XEo3EXj5GGZnH+Y1XbE2SXTfIG2wD2j+4GV9FOCvqFtrbWDfvh5BYil/zSnwawy0 NhvtMTT/IxFYQ1uXmZXwD0QvipCVS8j5mV0/BZTjDaeZ0w+oESO9gxi5g6sv9Pdsumt5 7yzek3TOq6wKl9k17av/iXjb+1IMJT5727xsg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=njg1nMF5A340qksp/XspDp5K0OrvuYfQ3dvK8BBJwgw=; b=HtoVCv5sjvV63XNfq6julhh554tnYLzzX/pbVGT8Q7BTw51JNLUA3TdUIDvdkJ0wM+ mJmTQWptOcFEa7pRhMR3S5jXuoI+Jz+Rn4MLJVP0LHrjacpu+U+rUb0fhvpMHNlctz4+ xkpUs5hd+ZHuan4M6BWtETL9Wt6oMlRZHom/4d9cSnNvmcHcNswcPisOQZ9+XxgCnUlH xubuLQyu6Dn+oFZrIqleE63h9Khw2oSA8C9qEWMekfQ+1WDnl63ahVbqPQlGDDOiHWMN RvFlcRs+emzxmKBuUO+mnbN2woXnjAxV2wLGEt3Pcpn2WKnm162xu2rFxbuiFFeIyNcw FTTQ== X-Gm-Message-State: ALyK8tLKFwdCxFvhFkPdinUnvD5uy+0dzcG/tGJVuYLIJfwvk+SU4Cf2BYJCvaS0wH+LL1myQSFuiN2LVBc75xDV X-Received: by 10.25.81.17 with SMTP id f17mr5054126lfb.206.1468476677803; Wed, 13 Jul 2016 23:11:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.205.133 with HTTP; Wed, 13 Jul 2016 23:10:58 -0700 (PDT) In-Reply-To: References: <1258648805.4446.1.camel@pasokon> From: Cyril Bouthors Date: Thu, 14 Jul 2016 10:10:58 +0400 Message-ID: Subject: Re: bug#4975: 23.1; comint.el: command line is sometimes echoed in the command output To: Andrew Hyatt Content-Type: multipart/alternative; boundary=001a114062bebde80c0537925e79 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 4975 X-Mailman-Approved-At: Thu, 14 Jul 2016 11:37:07 -0400 Cc: Johan Euphrosine , 4975@debbugs.gnu.org, Olin Shivers , Simon Marshall X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a114062bebde80c0537925e79 Content-Type: text/plain; charset=UTF-8 On Thu, Jul 14, 2016 at 8:20 AM, Andrew Hyatt wrote: > > Let me know if you (or anyone else) can still reproduce this, otherwise > I'll close this in a few weeks. > Andrew, As I said, literally 10 years ago: From: Cyril Bouthors To: 284727@bugs.debian.org Subject: Re: shell-mode: command line is sometimes echoed in the command output Date: Sun, 01 Jan *2006* 15:17:18 +0300 I can't reproduce this bug anymore in the current sid, I guess it was a bug in bash that was fixed with a recent upload. -- Cyril Bouthors -- Cyril Bouthors - go-managed.com +33-1-84-16-16-17 https://www.linkedin.com/in/cyrilbouthors --001a114062bebde80c0537925e79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Thu, Jul 14, 2016 at 8:20 AM, Andrew Hyatt <ahyatt@gmail.com> wrote:

Let me know if you (or anyone else) can still reproduce this, otherwise
I'll close this in a few weeks.

Andrew,
=

As I said, = literally 10 years ago:

From:=C2=A0= Cyril Bouthors <cyb@debian.org>=
Subject:=C2=A0Re: shell-mode: command line is sometime= s echoed in the command output
Date:= =C2=A0Sun, 01 Jan 2006 15:17:18 +0300
I can't reproduce this bug =
anymore in the current sid, I guess it was
a bug in bash that was fixed with a recent upload.
--=20
Cyril Bouthors


--
Cyril Bouthors - go-managed.com=C2=A0+33-1-84-16-16= -17
=
--001a114062bebde80c0537925e79-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 28 00:33:31 2016 Received: (at control) by debbugs.gnu.org; 28 Jul 2016 04:33:31 +0000 Received: from localhost ([127.0.0.1]:48733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSd0l-0005O9-IL for submit@debbugs.gnu.org; Thu, 28 Jul 2016 00:33:31 -0400 Received: from mail-qk0-f170.google.com ([209.85.220.170]:33661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSd0k-0005Nv-AV for control@debbugs.gnu.org; Thu, 28 Jul 2016 00:33:30 -0400 Received: by mail-qk0-f170.google.com with SMTP id p74so53048984qka.0 for ; Wed, 27 Jul 2016 21:33:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:to:from:subject; bh=vfeuEvSWXXQvI32vfXbJRb+X3Mim1ZCy8ybiEleBVqU=; b=HeUoUAg2xs1Yu23fWFNfvggwn2Te9XR4ZLcKsOLC59hNumnEOxwXQeirtutIY8Rufn rVimVQ9/VzByvWDT6+qAh7eNk+haEwKosKKHZv8VX0X5yBJRHvcd+hmjV9wt4P7V7XkB Pqb/TGB984476+2ZN4t+qQuFZB7DxMrhz/bHUANk4xGogB8A7JdZhuQQ/jbTfGWtCIEY voa5AeCXs4iagzRx2R1bp5nze7sbdmh65z+8f/PfKQwZcwGDRguRPvb8ADDALaIDfeQq X4PbpHoVxujKahKCV5G+nYkCbu39TWWDuN5MgSD4dF5dPrvxKcc2n49WF/Xz861WBNRf BU8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:message-id:to:from:subject; bh=vfeuEvSWXXQvI32vfXbJRb+X3Mim1ZCy8ybiEleBVqU=; b=k0ydljMEWE4iq3B9OHVACGaDSs7sxfCd7QxSR9PnCKygvn5Jc4eW0+I47BJ6BXiU1M +ZpF1Pv8vtPNxwmDgWsnMOcw3lSFr99AtSuEilStOdgW2x50yugR4OCdHsm9NhQCXN4o PtL3oGb81ZPGGl6mxJxxSlAhfe+sCv2a80PbquJM0C9q+GmWeiPDkMA57eFu4XwqplJp dwUUWtegPyUpBnop2eT7hg9lNWn9uYyMbEHcx8wzDsoBHkQ1FChONFMIzt5M2SmrN106 nPHz/SIIgoK8HaR5KG9HQleVemkpKesFx7zhdXw4hmRDSmV8Doe35VkOKmSaYnP59RyX 2ZDA== X-Gm-Message-State: AEkooutqq7CHcWegWZJ7DE5vmNwkzRCPbXtWSlZL49toYuF+hW/jL2g4mRuhck16Q2KniQ== X-Received: by 10.55.73.148 with SMTP id w142mr42144957qka.77.1469680404763; Wed, 27 Jul 2016 21:33:24 -0700 (PDT) Received: from Andrews-MacBook-Pro.local.ahyatt-laptop (cpe-74-73-128-199.nyc.res.rr.com. [74.73.128.199]) by smtp.gmail.com with ESMTPSA id n6sm6255141qke.31.2016.07.27.21.33.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jul 2016 21:33:23 -0700 (PDT) Date: Thu, 28 Jul 2016 00:33:23 -0400 Message-Id: To: control@debbugs.gnu.org From: Andrew Hyatt Subject: control message for bug #4975 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tags 4975 unreproducible close 4975 From unknown Mon Jun 23 07:53:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 25 Aug 2016 11:24:04 +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