1

I am working on windows machine. I have last org version (from February 2017). I have a remote host accessible by putty, where i have created org file of the following contents:

#+TITLE C language things

* Simple hello-world program

#+NAME hello world on C
#+BEGIN_SRC C :dir /pscp:tcl:/home/tc/development :main no
  #include <stdio.h>

  int main()
  {
      printf("Hello, world!");
      return 0;
  }
#+END_SRC

where tcl is name of saved putty configuration

When i evaluate codefragment, overall result is a failure (however, it is not a crash, and toggling debug on yields no backtrace) Here is what is output to Message buffer:

executing C code block...
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816iL0.c to /pscp:tcl:/tmp/C-src-4816VBu.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.4816iL0.c to /pscp:tcl:/tmp/C-src-4816VBu.c...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816hfJ.exe to /pscp:tcl:/tmp/C-bin-4816UVD.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.4816hfJ.exe to /pscp:tcl:/tmp/C-bin-4816UVD.exe...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816upP.c to /pscp:tcl:/tmp/C-src-4816VBu.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.4816upP.c to /pscp:tcl:/tmp/C-src-4816VBu.c...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816I-b to /pscp:tcl:/tmp/ob-input-48167zV...
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.4816I-b to /pscp:tcl:/tmp/ob-input-48167zV...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816iSo to /pscp:tcl:/tmp/ob-error-4816VIi...
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.4816iSo to /pscp:tcl:/tmp/ob-error-4816VIi...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.4816vcu to /pscp:tcl:/tmp/ob-input-48167zV...failed
byte-code: Spawning child process: invalid argument

What is going on there? What does error in the end mean? Most importantly, is code block being evaluated on remote host at all? Can output of org-babel commands be turned on to get that information? Preferably in such a way that all commands executed will be visible.

With tramp tracing turned on, these are copy commands that were executed by tramp:

29 matches in 17 lines for "copy" in buffer: *debug tramp/pscp tcl*
    143:10:35:24.212000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208n9z.c to /pscp:tcl:/tmp/C-src-2208azt.c...
    144:10:35:24.224000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r "c:/Users/Ivan/AppData/Local/Temp/tramp.2208n9z.c" "tcl:/tmp/C-src-2208azt.c" && echo tramp_exit_status 0 || echo tramp_exit_status 1
    161:10:35:24.424000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208n9z.c to /pscp:tcl:/tmp/C-src-2208azt.c...done
    206:10:35:25.041000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208mRJ.exe to /pscp:tcl:/tmp/C-bin-2208ZHD.exe...
    207:10:35:25.050000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r "c:/Users/Ivan/AppData/Local/Temp/tramp.2208mRJ.exe" "tcl:/tmp/C-bin-2208ZHD.exe" && echo tramp_exit_status 0 || echo tramp_exit_status 1
    224:10:35:25.245000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208mRJ.exe to /pscp:tcl:/tmp/C-bin-2208ZHD.exe...done
    246:10:35:25.572000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208zbP.c to /pscp:tcl:/tmp/C-src-2208azt.c...
    247:10:35:25.583000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r "c:/Users/Ivan/AppData/Local/Temp/tramp.2208zbP.c" "tcl:/tmp/C-src-2208azt.c" && echo tramp_exit_status 0 || echo tramp_exit_status 1
    264:10:35:25.832000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208zbP.c to /pscp:tcl:/tmp/C-src-2208azt.c...done
    289:10:35:26.224000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208Nwb to /pscp:tcl:/tmp/ob-input-2208AmV...
    290:10:35:26.236000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r "c:/Users/Ivan/AppData/Local/Temp/tramp.2208Nwb" "tcl:/tmp/ob-input-2208AmV" && echo tramp_exit_status 0 || echo tramp_exit_status 1
    307:10:35:26.424000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208Nwb to /pscp:tcl:/tmp/ob-input-2208AmV...done
    332:10:35:26.823000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208nEo to /pscp:tcl:/tmp/ob-error-2208a6h...
    333:10:35:26.834000 tramp-do-copy-or-rename-file-out-of-band (6) # c:\mingw_mine\libexec\emacs\24.5\x86_64-w64-mingw32\cmdproxy.exe -c pscp -scp -q -r "c:/Users/Ivan/AppData/Local/Temp/tramp.2208nEo" "tcl:/tmp/ob-error-2208a6h" && echo tramp_exit_status 0 || echo tramp_exit_status 1
    350:10:35:27.029000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.2208nEo to /pscp:tcl:/tmp/ob-error-2208a6h...done
    384:10:35:27.500000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.22080Ou to /pscp:tcl:/tmp/ob-input-2208AmV...
    385:10:35:27.512000 tramp-do-copy-or-rename-file (0) # Copying c:/Users/Ivan/AppData/Local/Temp/tramp.22080Ou to /pscp:tcl:/tmp/ob-input-2208AmV...failed

In /tmp folder on remote host, these are new files that have appeared:

  • C-bin-2208ZHD.exe
  • C-src-2208azt.c
  • ob-error-2208a6h
  • ob-input-2208AmV

Following commands were executed by tramp remotely:

59 matches for "send-command" in buffer: *debug tramp/pscp tcl*
      3:10:35:22.795000 tramp-send-command (6) # echo are you awake
      7:10:35:22.847000 tramp-send-command (6) # (test -e /tmp/C-src-2208azt.c || test -h /tmp/C-src-2208azt.c) && /bin/ls --color=never -ildn /tmp/C-src-2208azt.c
     13:10:35:22.902000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) && /bin/ls --color=never -ildn /tmp
     19:10:35:22.958000 tramp-send-command (6) # test -e /tmp/C-src-2208azt.c 2>/dev/null; echo tramp_exit_status $?
     26:10:35:23.058000 tramp-send-command (6) # ( base64 </dev/null 2>/dev/null); echo tramp_exit_status $? )
     31:10:35:23.111000 tramp-send-command (6) # ( base64 </dev/null 2>/dev/null); echo tramp_exit_status $? )
     36:10:35:23.163000 tramp-send-command (6) # ( mimencode -b </dev/null 2>/dev/null); echo tramp_exit_status $? )
     41:10:35:23.215000 tramp-send-command (6) # ( mmencode -b </dev/null 2>/dev/null); echo tramp_exit_status $? )
     46:10:35:23.267000 tramp-send-command (6) # ( recode data..base64 </dev/null 2>/dev/null); echo tramp_exit_status $? )
     53:10:35:23.320000 tramp-send-command (6) # ( test -c /dev/stdout 2>/dev/null); echo tramp_exit_status $? )
     58:10:35:23.372000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
     63:10:35:23.424000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
     68:10:35:23.476000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
     73:10:35:23.528000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
     84:10:35:23.610000 tramp-send-command (6) # ( base64 </dev/null 2>/dev/null); echo tramp_exit_status $? )
     89:10:35:23.661000 tramp-send-command (6) # ( base64 </dev/null 2>/dev/null); echo tramp_exit_status $? )
     94:10:35:23.713000 tramp-send-command (6) # ( mimencode -b </dev/null 2>/dev/null); echo tramp_exit_status $? )
     99:10:35:23.765000 tramp-send-command (6) # ( mmencode -b </dev/null 2>/dev/null); echo tramp_exit_status $? )
    104:10:35:23.817000 tramp-send-command (6) # ( recode data..base64 </dev/null 2>/dev/null); echo tramp_exit_status $? )
    111:10:35:23.869000 tramp-send-command (6) # ( test -c /dev/stdout 2>/dev/null); echo tramp_exit_status $? )
    116:10:35:23.921000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
    121:10:35:23.974000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
    126:10:35:24.026000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
    131:10:35:24.078000 tramp-send-command (6) # ( uuencode xxx </dev/null 2>/dev/null); echo tramp_exit_status $? )
    139:10:35:24.150000 tramp-send-command (6) # test -d /tmp/C-src-2208azt.c 2>/dev/null; echo tramp_exit_status $?
    157:10:35:24.369000 tramp-send-command (6) # chmod 0666 /tmp/C-src-2208azt.c 2>/dev/null; echo tramp_exit_status $?
    165:10:35:24.427000 tramp-send-command (6) # (test -e /home || test -h /home) && /bin/ls --color=never -ildn /home
    171:10:35:24.481000 tramp-send-command (6) # (test -e /home/tc || test -h /home/tc) && /bin/ls --color=never -ildn /home/tc
    177:10:35:24.535000 tramp-send-command (6) # (test -e /home/tc/development || test -h /home/tc/development) && /bin/ls --color=never -ildn /home/tc/development
    182:10:35:24.635000 tramp-send-command (6) # chown 1001:50 /tmp/C-src-2208azt.c
    186:10:35:24.746000 tramp-send-command (6) # (test -e /tmp/C-bin-2208ZHD.exe || test -h /tmp/C-bin-2208ZHD.exe) && /bin/ls --color=never -ildn /tmp/C-bin-2208ZHD.exe
    192:10:35:24.800000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) && /bin/ls --color=never -ildn /tmp
    198:10:35:24.855000 tramp-send-command (6) # test -e /tmp/C-bin-2208ZHD.exe 2>/dev/null; echo tramp_exit_status $?
    202:10:35:24.983000 tramp-send-command (6) # test -d /tmp/C-bin-2208ZHD.exe 2>/dev/null; echo tramp_exit_status $?
    220:10:35:25.189000 tramp-send-command (6) # chmod 0777 /tmp/C-bin-2208ZHD.exe 2>/dev/null; echo tramp_exit_status $?
    225:10:35:25.300000 tramp-send-command (6) # chown 1001:50 /tmp/C-bin-2208ZHD.exe
    229:10:35:25.352000 tramp-send-command (6) # (test -e /tmp/C-src-2208azt.c || test -h /tmp/C-src-2208azt.c) && /bin/ls --color=never -ildn /tmp/C-src-2208azt.c
    236:10:35:25.407000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) && /bin/ls --color=never -ildn /tmp
    242:10:35:25.514000 tramp-send-command (6) # test -d /tmp/C-src-2208azt.c 2>/dev/null; echo tramp_exit_status $?
    260:10:35:25.777000 tramp-send-command (6) # chmod 0666 /tmp/C-src-2208azt.c 2>/dev/null; echo tramp_exit_status $?
    265:10:35:25.915000 tramp-send-command (6) # chown 1001:50 /tmp/C-src-2208azt.c
    269:10:35:25.969000 tramp-send-command (6) # (test -e /tmp/ob-input-2208AmV || test -h /tmp/ob-input-2208AmV) && /bin/ls --color=never -ildn /tmp/ob-input-2208AmV
    275:10:35:26.023000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) && /bin/ls --color=never -ildn /tmp
    281:10:35:26.077000 tramp-send-command (6) # test -e /tmp/ob-input-2208AmV 2>/dev/null; echo tramp_exit_status $?
    285:10:35:26.167000 tramp-send-command (6) # test -d /tmp/ob-input-2208AmV 2>/dev/null; echo tramp_exit_status $?
    303:10:35:26.372000 tramp-send-command (6) # chmod 0666 /tmp/ob-input-2208AmV 2>/dev/null; echo tramp_exit_status $?
    308:10:35:26.510000 tramp-send-command (6) # chown 1001:50 /tmp/ob-input-2208AmV
    312:10:35:26.565000 tramp-send-command (6) # (test -e /tmp/ob-error-2208a6h || test -h /tmp/ob-error-2208a6h) && /bin/ls --color=never -ildn /tmp/ob-error-2208a6h
    318:10:35:26.619000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) && /bin/ls --color=never -ildn /tmp
    324:10:35:26.674000 tramp-send-command (6) # test -e /tmp/ob-error-2208a6h 2>/dev/null; echo tramp_exit_status $?
    328:10:35:26.767000 tramp-send-command (6) # test -d /tmp/ob-error-2208a6h 2>/dev/null; echo tramp_exit_status $?
    346:10:35:26.974000 tramp-send-command (6) # chmod 0666 /tmp/ob-error-2208a6h 2>/dev/null; echo tramp_exit_status $?
    351:10:35:27.074000 tramp-send-command (6) # chown 1001:50 /tmp/ob-error-2208a6h
    355:10:35:27.128000 tramp-send-command (6) # (test -e /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe || test -h /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe) && /bin/ls --color=never -ild /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe
    359:10:35:27.181000 tramp-send-command (6) # (test -e /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe || test -h /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe) && /bin/ls --color=never -ildn /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe
    362:10:35:27.232000 tramp-send-command (6) # test -x /mingw_mine/libexec/emacs/24.5/x86_64-w64-mingw32/cmdproxy.exe 2>/dev/null; echo tramp_exit_status $?
    367:10:35:27.286000 tramp-send-command (6) # (test -e /tmp/ob-input-2208AmV || test -h /tmp/ob-input-2208AmV) && /bin/ls --color=never -ildn /tmp/ob-input-2208AmV
    374:10:35:27.342000 tramp-send-command (6) # (test -e /tmp || test -h /tmp) && /bin/ls --color=never -ildn /tmp
    380:10:35:27.442000 tramp-send-command (6) # test -d /tmp/ob-input-2208AmV 2>/dev/null; echo tramp_exit_status $?

There are two conclusions i can make:

  1. remote host's gcc was not called
  2. executable file was created on local host by mingw's gcc

Full trace for tramp can be found here.

  • It looks as if something is happening on the remote, but it does not complete. I would turn on more detailed tracing on tramp and also look at all the remote files created under /tmp (assuming they are still there). – NickD Mar 30 '17 at 16:50
  • Done. Conclusions are not happy – Srv19 Mar 31 '17 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.