Stack Overflow, was: Re: How to solve: module 'syscalls' requires package OS
Jean Louis <[email protected]> Mon, 27 Mar 2017 15:45:42 +0300
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <[email protected]> |
I have done as following: clisp -i pipe-from-org-to-markdown.lisp and then saved memory image, and I was getting problem, and now I have done with: clisp -q -norc -i pipe-from-org-to-markdown.lisp and then saved memory image, and now I don't see a problem happening, it is just waiting for standard input, without stack overflow. While my particular case is solved, maybe it is not solved in the CLISP. Yet, I still don't know what to do to solve: module 'syscalls' requires package OS in other program. On Mon, Mar 27, 2017 at 03:29:19PM +0300, Jean Louis wrote: > On Mon, Mar 27, 2017 at 08:20:27AM -0400, Sam Steingold wrote: > > > * Jean Louis <[email protected]> [2017-03-24 23:41:51 +0300]: > > > > > > Now, the problem is that in this version it works if I launch it with > > > lisp (CLISP), yet if I launch it as saved memory image, I get stack > > > overflow with RESET. Do you know why the saved memory image is giving > > > me stack overflow? > > > > I think I already said that this is a known bug > > https://sourceforge.net/p/clisp/bugs/695/ > > with a know work-around (see the bug). > > I am not sure if that is the same bug. Here is the program, and now it > is just working well, it accepts Org file on standard input, and spits > out the HTML. > > If I make memory image with this one, it is heating the CPU, and I get > stack overflow. After researching the bug 695, I could not find > pointers and I don't know what can I do to make the work around. > > (defparameter memdir "/run/shm/") > (defparameter tmp-file "rcd-wrs-XXXXXX") > (defparameter tmp-org (format nil "~a~a.org" memdir tmp-file)) > (defparameter tmp-md (format nil "~a~a.md" memdir tmp-file)) > (load "/home/data1/protected/Programming/git/RCDBusiness/lib/lisp/streamtools.lisp") > ;; (require "syscalls") > > (defun main () > (let ((input '()) > (output '())) > (loop :for line = (read-line *standard-input* nil nil) > :while line > :do (push line input)) > (setf input (format nil "~{~a~^~%~}" (reverse input))) > (with-open-file (stream tmp-org :direction :output :if-exists :supersede :if-does-not-exist :create :external-format "utf-8") > (princ input stream)) > (shell (format nil "emacs -Q -l ~~/.emacs.d/elpa/org-20170210/org-autoloads.el \"~a\" --batch -f org-mode -f org-md-export-to-markdown --kill" tmp-org)) > (with-open-file (stream tmp-md :direction :input :external-format "utf-8") > (loop :for line = (read-line stream nil nil) > :while line > :do (push line output))) > (setf output (format nil "~{~a~^~%~}" (reverse output))) > (setf output (slurp-stream-io-command "/usr/bin/discount_markdown -F 0x4" output)) > (princ output)) > (exit)) > > ;; (saveinitmem "org2html" :quiet t :init-function 'main :verbose nil :norc t :documentation "Converts Org standard input into markdown" :executable t) > > (main) ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ clisp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-list