[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Bug: Error during evaluation of C source blocks on remote machine [9

From: trus19
Subject: [O] Bug: Error during evaluation of C source blocks on remote machine [9.1.2 (9.1.2-15-g1d5142-elpa @ c:/Users/Ivan/.emacs.d/elpa/org-20171016/)]
Date: Mon, 23 Oct 2017 13:11:25 +0300

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See


Your bug report will be posted to the Org mailing list.

I have org file with C source block. I work with file on Windows PC.
I have linux machine, which is accessible through Putty. For reasons, i
want to evaluate C code blocks there (mostly because it has gcc).

Here is relevant fragment of my org file:

> #+PROPERTY: header-args :noweb yes :results verbatim :dir /pscp:tcl:/home/tc 
> :flags -std=c99
> Ok, time for something more interesting.
> Let's say we want to change 2 values between variables. How to do
> that? As we learned, with pointers, like:
> #+NAME: swap_function
>   void swap_int(int* pa, int* pb)
>   {
>       int c = *pa;
>       ,*pa = *pb;
>       ,*pb = c;
>   }
>   #define SWAP(a, b, t) {t temp##t; temp##t = a; a = b; b = temp##t;}
> Trying it out:
> #+BEGIN_SRC C :main no
>   #include <stdio.h>
>   <<swap_function>>
>   void main()
>   {
>       int a = 1, b = 19;
>       printf("Before testing a=%d, b=%d\n", a, b);
>       swap_int(&a, &b);
>       printf("After testing function a=%d, b=%d\n", a, b);
>       SWAP(a, b, int);
>       printf("After testing macro a=%d, b=%d\n", a, b);        
>   }

However, when i evaluate source block, i get the following error:

> Spawning child process: invalid argument

I have tried to debug the issue. Error is produced by call to

> (write-region start end input-file)

in function org-babel--shell-command-on-region. This supposedly creates
on remote machine file containing user input (actually,
empty). Evaluation does not go to the invocation of compiler command
line, sadly.

How can that be fixed?

Emacs  : GNU Emacs 24.5.1 (x86_64-w64-mingw32)
 of 2016-01-21 on MICROSOFT-PC
Package: Org mode version 9.1.2 (9.1.2-15-g1d5142-elpa @ 

current state:
 org-journal-mode-hook '(#[nil "\301\302\303\304$\207"
                           [org-journal-encrypt-on org-add-hook 
org-journal-encryption-hook nil t] 5]
                         (lambda nil
                          (org-add-hook org-journal-encrypt-on (quote 
org-journal-encryption-hook) nil t))
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
 org-speed-command-hook '(org-speed-command-activate 
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-log-done 'time
 org-confirm-shell-link-function 'yes-or-no-p
 org-agenda-restore-windows-after-quit t
 org-agenda-custom-commands '(("n" "Agenda and all TODO's" ((agenda "") 
(alltodo "")))
                              ("d" "Undated tasks" alltodo "" 
((org-agenda-todo-ignore-with-date t))))
 org-use-sub-superscripts '{}
 org-default-notes-file "c:/Users/Ivan/Dropbox/org/notes.org"
 org-agenda-include-diary t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-from-is-user-regexp nil
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '((lambda nil (define-key org-mode-map (kbd "C-c f") (quote 
                 (lambda nil (make-local-variable (quote 
                  (make-local-variable (quote coding-system-for-write))
                  (setq coding-system-for-read (quote utf-8-dos)) (setq 
coding-system-for-write (quote utf-8)))
                 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-all append local]
                   5 "\n\n(fn)"]
                 #[0 "\300\301\302\303\304$\207"
                   [add-hook change-major-mode-hook org-babel-show-result-all 
append local] 5 "\n\n(fn)"]
                 org-babel-result-hide-spec org-babel-hide-all-hashes 
 org-refile-targets '((org-agenda-files :maxlevel . 3))
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
 org-outline-path-complete-in-steps nil
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-refile-use-outline-path t
 org-directory "c:/Users/Ivan/Dropbox/org"
 org-enforce-todo-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
 org-journal-dir "c:/Users/Ivan/Dropbox/org/journal/"
 org-refile-allow-creating-parent-nodes 'confirm
 org-todo-keywords '((sequence "LATER(l)" "TODO(t!)" "CHECK(k!)" "|" "DONE(d)")
                     (sequence "HOLD(h@/!)" "|" "CANCELLED(c@/!)"))
 org-agenda-window-setup 'current-window
 org-babel-tangle-lang-exts '(("D" . "d") ("C++" . "cpp") ("emacs-lisp" . "el") 
("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-link-parameters '(("id" :follow org-id-open) ("rmail" :follow 
org-rmail-open :store org-rmail-store-link)
                       ("mhe" :follow org-mhe-open :store org-mhe-store-link)
                       ("irc" :follow org-irc-visit :store org-irc-store-link)
                       ("info" :follow org-info-open :export org-info-export 
:store org-info-store-link)
                       ("gnus" :follow org-gnus-open :store org-gnus-store-link)
                       ("docview" :follow org-docview-open :export 
org-docview-export :store
                       ("bibtex" :follow org-bibtex-open :store 
                       ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete org-bbdb-complete-link
                        :store org-bbdb-store-link)
                       ("w3m" :store org-w3m-store-link) ("file+sys") 
                       ("doi" :follow org--open-doi-link) ("elisp" :follow 
                       ("file" :complete org-file-complete-link)
                       ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" 
                       ("help" :follow org--open-help-link)
                       ("http" :follow (lambda (path) (browse-url (concat 
"http:" path))))
                       ("https" :follow (lambda (path) (browse-url (concat 
"https:" path))))
                       ("mailto" :follow (lambda (path) (browse-url (concat 
"mailto:"; path))))
                       ("news" :follow (lambda (path) (browse-url (concat 
"news:"; path))))
                       ("shell" :follow org--open-shell-link))
 org-babel-load-languages '((C . t) (emacs-lisp . t))
 org-reveal-start-hook '(org-decrypt-entry)
 org-agenda-files '("~/Dropbox/org/notes.org" "~/Dropbox/org/projects.org" 
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]