call stack overflow in function last : sys-info

Started by newdep, May 24, 2005, 11:42:39 AM

Previous topic - Next topic

newdep

Hi Lutz,



I realy have strange problems with newlisp ;-)



It seems that since release 8.5.6 when the /usr/share/newlisp/init.lsp

exists and also the $HOME/.init.lsp newlisp wont run and gives this error ->

"call stack overflow in function last : sys-info"



Get back on it when i found it..



- Norman -
-- (define? (Cornflakes))

newdep

#1
Strange problem..



It does load the .init.lsp but it goes wrong somewhere.. Its one of the

two functions.. defun or edit..



PS: im using the default init.lsp from the package 8.5.9



Norman.
-- (define? (Cornflakes))

newdep

#2
well its seems that this is the trouble maker ->

(if $HOME (load (append $HOME "/.init.lsp")))





ie. ->

> (load "/home/newlisp/.init.lsp")



call stack overflow in function & : last









everything else inside init.lsp works...



Norman.
-- (define? (Cornflakes))

Lutz

#3
Are you loading .init.lsp again from inside .init.lsp recursevely ?-)



Lutz

newdep

#4
Looks like it ;-)

but thats how the init.lsp looks like im my newlisp package..

It runs fine from /usr/share/newlisp



but when its inside my $HOME/ dir the problems starts..



Im still seeking for the problem...



Norman.
-- (define? (Cornflakes))

newdep

#5
Oke workaround...



lets make it ->



(constant (global '$HOME) (or (env "HOME") (env "USERPROFILE") (env "DOCUMENT_ROOT")))

(if (and $HOME (not (file? (append $HOME "/.init.lsp"))))  (load (append $HOME "/.init.lsp")))

;; does only make sence when the init.lsp stays in /usr/share/newlisp



but then again this works too, adding a comment in init.lsp ->

;; remove these lines from the .init.lsp file when placed in $HOME









BUT !!!

now my system generates a Segmentation Fault when calling (edit edit)

and exiting from the editor (joe or vim)





> (edit defun)



symbol is protected in function define-macro : (defun _func-name _arguments)



> (edit edit)

...in vim

...:q!

Segmentation fault
-- (define? (Cornflakes))

Lutz

#6
Don't do:



(edit edit)



You will overwrite the 'edit' function while it is executing, the edit macro will overwrite itself! that will certainly crash the system ;)



To the first part of your question: if you have the same /usr/share/newlisp/init.lsp as your .init.lsp in your $HOME directory, then it will load itself recursevely until the stack overflows. So don't make them the same.



Lutz