call stack overflow in function last : sys-info

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

call stack overflow in function last : sys-info

Post by 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
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

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
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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

Lutz

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

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
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

Post by newdep »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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

Locked