From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?0JjQstCw0L0g0KLRgNGD0YHQutC+0LI=?= Subject: [BUG]C source block evaluation fails over pscp Date: Tue, 31 Oct 2017 15:02:19 +0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c073d8ceba39f055cd686cd" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9VFV-0001tJ-L7 for emacs-orgmode@gnu.org; Tue, 31 Oct 2017 08:02:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9VFO-0002fD-V9 for emacs-orgmode@gnu.org; Tue, 31 Oct 2017 08:02:29 -0400 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:49753) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e9VFO-0002cF-Kc for emacs-orgmode@gnu.org; Tue, 31 Oct 2017 08:02:22 -0400 Received: by mail-wm0-x236.google.com with SMTP id b189so21907922wmd.4 for ; Tue, 31 Oct 2017 05:02:21 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode --94eb2c073d8ceba39f055cd686cd Content-Type: text/plain; charset="UTF-8" I am working on Windows machine with org file with C source block. I want to evaluate code block on remote machine accessible to me with PuTTY. Here is relevant part of the org file: #+PROPERTY: header-args :noweb yes :results verbatim :dir /pscp:tcl:/home/tc Now, let us move to the green fields of user input. #+NAME: echo_arguments #+BEGIN_SRC C :main no #include int main(int argc, const char* argv[]) { printf("Has %d arguments\n", argc); for(int i = 0; i < argc; ++i) printf("Argument %d:\n%s\n", i, argv[i]); return 0; } #+END_SRC Evaluation of source block results in error with the following message: Spawning child process: invalid argument Full messages output is executing C code block (echo_arguments)... Continue... Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760k9p.c to /pscp:tcl:/tmp/C-src-5760Xzj.c... Tramp: Waiting for prompts from remote shell... Tramp: Process has finished. Tramp: Waiting for prompts from remote shell...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760k9p.c to /pscp:tcl:/tmp/C-src-5760Xzj.c...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760-R2.exe to /pscp:tcl:/tmp/C-bin-5760xHw.exe... Tramp: Waiting for prompts from remote shell... Tramp: Process has finished. Tramp: Waiting for prompts from remote shell...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760-R2.exe to /pscp:tcl:/tmp/C-bin-5760xHw.exe...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760wbF.c to /pscp:tcl:/tmp/C-src-5760Xzj.c... Tramp: Waiting for prompts from remote shell... Tramp: Process has finished. Tramp: Waiting for prompts from remote shell...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760wbF.c to /pscp:tcl:/tmp/C-src-5760Xzj.c...done Break Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760KwR to /pscp:tcl:/tmp/ob-input-57609lL... Tramp: Waiting for prompts from remote shell... Tramp: Process has finished. Tramp: Waiting for prompts from remote shell...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760KwR to /pscp:tcl:/tmp/ob-input-57609lL...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760kEe to /pscp:tcl:/tmp/ob-error-5760X6X... Tramp: Waiting for prompts from remote shell... Tramp: Process has finished. Tramp: Waiting for prompts from remote shell...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760kEe to /pscp:tcl:/tmp/ob-error-5760X6X...done Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760xOk to /pscp:tcl:/tmp/ob-input-57609lL...failed edebug-signal: Spawning child process: invalid argument Debugging shows that error occurs inside function org-babel-eval when call to org-babel--shell-command-on-region is made at the line 105 of org-eval.el. The line is: (write-region start end input-file) There are two things that seem strange: 1. Region is actually empty - input region for C file compilation is empty. 2. There is no problem in writing to remote machine. C source file is written to location needed. 3. Command line is "gcc -o \"/tmp/C-bin-5760L4M.exe\" \"/tmp/C-src-5760xjA.c\" " If that command line is executed on remote machine, compilation succeeds Was that error introduced in some recen org version? --94eb2c073d8ceba39f055cd686cd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am working on Windows machine with org fi= le with C source block. I want to evaluate code block on remote machine acc= essible to me with PuTTY. Here is relevant part of the org file:

#+PROPERTY: header-args :noweb yes :results ve= rbatim :dir /pscp:tcl:/home/tc

Now, let us move to the green fields = of user input.

#+NAME: echo_arguments
#+BEGIN_SRC C :main no
= =C2=A0 #include <stdio.h>

=C2=A0 int main(int argc, const char= * argv[])
=C2=A0 {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("Has %d= arguments\n", argc);
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for(int i =3D = 0; i < argc; ++i)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 printf("Argument %d:\n%s\n", i, argv[i]);
=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 return 0;
=C2=A0 }

#+END_SRC

= Evaluation of source block results in error with the following message:
=
Spawning child process: invalid argumen= t

Full messages output is
executing C code block (echo_arguments= )...
Continue...
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760k= 9p.c to /pscp:tcl:/tmp/C-src-5760Xzj.c...
Tramp: Waiting for prompts fro= m remote shell...
Tramp: Process has finished.
Tramp: Waiting for pro= mpts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/Temp/t= ramp.5760k9p.c to /pscp:tcl:/tmp/C-src-5760Xzj.c...done
Copying c:/Users= /Ivan/AppData/Local/Temp/tramp.5760-R2.exe to /pscp:tcl:/tmp/C-bin-5760xHw.= exe...
Tramp: Waiting for prompts from remote shell...
Tramp: Process= has finished.
Tramp: Waiting for prompts from remote shell...done
Co= pying c:/Users/Ivan/AppData/Local/Temp/tramp.5760-R2.exe to /pscp:tcl:/tmp/= C-bin-5760xHw.exe...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.= 5760wbF.c to /pscp:tcl:/tmp/C-src-5760Xzj.c...
Tramp: Waiting for prompt= s from remote shell...
Tramp: Process has finished.
Tramp: Waiting fo= r prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/T= emp/tramp.5760wbF.c to /pscp:tcl:/tmp/C-src-5760Xzj.c...done
Break
Co= pying c:/Users/Ivan/AppData/Local/Temp/tramp.5760KwR to /pscp:tcl:/tmp/ob-i= nput-57609lL...
Tramp: Waiting for prompts from remote shell...
Tramp= : Process has finished.
Tramp: Waiting for prompts from remote shell...d= one
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760KwR to /pscp:tcl:= /tmp/ob-input-57609lL...done
Copying c:/Users/Ivan/AppData/Local/Temp/tr= amp.5760kEe to /pscp:tcl:/tmp/ob-error-5760X6X...
Tramp: Waiting for pro= mpts from remote shell...
Tramp: Process has finished.
Tramp: Waiting= for prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Loca= l/Temp/tramp.5760kEe to /pscp:tcl:/tmp/ob-error-5760X6X...done
Copying c= :/Users/Ivan/AppData/Local/Temp/tramp.5760xOk to /pscp:tcl:/tmp/ob-input-57= 609lL...failed
edebug-signal: Spawning child process: invalid argument

Debugging shows that error oc= curs inside function org-babel-eval when call to
=C2=A0org-babel--shell= -command-on-region is made at the line 105 of org-eval.el. The line is:

(write-region start end in= put-file)

There are two thin= gs that seem strange:

1. Region is actually empty - input regi= on for C file compilation is empty.
2. There is no problem in writing to= remote machine. C source file is written to location needed.
3. Command= line is
"gcc -o \"/tmp/C-bin-= 5760L4M.exe\"=C2=A0 \"/tmp/C-src-5760xjA.c\" "
=C2= =A0=C2=A0 If that command line is executed on remote machine, compilation s= ucceeds

Was that error introduced in some recen org version?
--94eb2c073d8ceba39f055cd686cd--