From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?J=FCrgen_H=F6tzel?= Newsgroups: gmane.emacs.devel Subject: Race condition in eshell-gather-process-output Date: Sat, 19 Jan 2013 12:28:19 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1358594926 2101 80.91.229.3 (19 Jan 2013 11:28:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jan 2013 11:28:46 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 19 12:29:04 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TwWbf-0001iE-BG for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2013 12:29:03 +0100 Original-Received: from localhost ([::1]:34277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwWbO-0005ko-Gu for ged-emacs-devel@m.gmane.org; Sat, 19 Jan 2013 06:28:46 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwWbL-0005ki-VS for emacs-devel@gnu.org; Sat, 19 Jan 2013 06:28:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwWbK-0001rj-Qg for emacs-devel@gnu.org; Sat, 19 Jan 2013 06:28:43 -0500 Original-Received: from gerolde.archlinux.org ([66.211.214.132]:41141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwWbK-0001pI-N5 for emacs-devel@gnu.org; Sat, 19 Jan 2013 06:28:42 -0500 Original-Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by gerolde.archlinux.org (Postfix) with ESMTPSA id 9766C9026A for ; Sat, 19 Jan 2013 06:28:40 -0500 (EST) Original-Received: by mail-ie0-f180.google.com with SMTP id c10so7655798ieb.11 for ; Sat, 19 Jan 2013 03:28:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-originating-ip:from:date:message-id :subject:to:content-type:content-transfer-encoding :x-gm-message-state; bh=ilR9TRy2BYtYrQaqDUmddqyacaw8BrwQygVxfeeC/J0=; b=BfQDqtx9tcMzxql7oCd3BJ7WmT29QGjFhc9pyNgi87d+KhsO4oQVWWlgLR1xxXICxr VIp32X/N6LN4Bxcvg0sKK41rXjlTj8uN6eUhWCjR7VyT/MLO5Os3SQHz2muuTHSTTmOK Zt5Kax1rUu/UTp2bQThXncHBzEsOaDROQ4h4kKwZwJbfkD6JxNnAJkexNZRgW0cHm5JN lDPw7ubKz/BcYpnMY2ntpc8YqkXbTSrBk0dWSRhk8x+vKFGEPbpn9ERHIKzMhNSzQWBN Eh0lEMx8FXh5qHcPzyRauwxFlPAaiMbp7nvbmN7JQp+9f9GLmZKN5YtXN14MxbTwTSdv N7Eg== X-Received: by 10.42.215.196 with SMTP id hf4mr1089473icb.23.1358594920046; Sat, 19 Jan 2013 03:28:40 -0800 (PST) Original-Received: by 10.64.33.80 with HTTP; Sat, 19 Jan 2013 03:28:19 -0800 (PST) X-Originating-IP: [88.68.60.147] X-Gm-Message-State: ALoCoQlm8YrZCCPYMx6CpG0ucHc0dp7Ucpuu58zxEU0UmxTNIlbZyyivSvjfuIst8QqIq7ExEUPC X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 66.211.214.132 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:156468 Archived-At: Hi, I stumbled across this while debugging eshell/tramp external commands: In eshell-gather-process-output the external process is started using start-file-process: (setq proc (let ((process-connection-type (unless (eshell-needs-pipe-p command) process-connection-type)) (command (or (file-remote-p command 'localname) command))) (apply 'start-file-process (file-name-nondirectory command) nil ;; `start-process' can't deal with relative filenames. (append (list (expand-file-name command)) args)))) ---------------------------------------------------------------------------= ------------- something can happen meanwhile: The process may have written output (nil output buffer) ---------------------------------------------------------------------------= ------------- (eshell-record-process-object proc) (set-process-buffer proc (current-buffer)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Maybe too late to set output buffer! Why is the output buffer not set directly: (apply 'start-file-process (file-name-nondirectory command) (current-buffer) ...) Regards, J=FCrgen