OS Shen 19.2: Crashing the underlying Common LISP

83 views
Skip to first unread message

Antti Ylikoski

unread,
Apr 15, 2017, 5:28:57 AM4/15/17
to Shen

I came across a problem with the OS Shen, the one that only is
supported with the GNU CLisp.  It is the OS Shen 19.2.

I finally got my N-level backpropagation ANN program to the shape that
it would probably work OK, for commercial use.  Then Shen file is
~2200 lines of Shen code.

But the program, so it seems, is so large and complex that it will
crash the underlying LISP, ie the GNU CLisp.  Below is a sample run.

I don't really know if anyone easily can help; but I'm anyway
mentioning this in the group here.


--------------------------------------------------

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. Kaikki oikeudet pidätetään.

c:\Users\Hp\Dropbox\pctronmll>.\Shen
.\Shen

c:\Users\Hp\Dropbox\pctronmll>clisp -M Shen.mem -q -m 100MB 

Shen, copyright (C) 2010-2015 Mark Tarver
running under Common Lisp, implementation: CLisp
port 1.9 ported by Mark Tarver


(0-) (tc +)
true

(1+) (load "maths-lib1.shen")

sign : (number --> number)
abs : (number --> number)
floor : (number --> number)
maths.floor-pos : (number --> number)
maths.floor-neg : (number --> number)
maths.floor-h : (number --> (number --> (number --> number)))
ceiling : (number --> number)

[snip...]

max : (number --> (number --> number))
min : (number --> (number --> number))
run time: 6.359375 secs

typechecked in 30115 inferences
loaded : symbol

(2+) (load "pctronmll.shen")

*** - Program stack overflow. RESET

c:\Users\Hp\Dropbox\pctronmll>
c:\Users\Hp\Dropbox\pctronmll>

--------------------------------------------------


yours, AJY
Finland, the EU


Mark Tarver

unread,
Apr 15, 2017, 5:41:57 AM4/15/17
to Shen
I use Shen/SBCL.  I'd first find if it happens under that platform; if it does, perhaps you have some deep type error in the program.  

2200 lines is a lot for one file; try splitting it up.   That said,  I've never had a problem loading a program because of size, but then my biggest file has been about 1000 lines.

Mark

Antti Ylikoski

unread,
Apr 15, 2017, 8:54:27 AM4/15/17
to Shen
What would be the simplest and most straightforward way to divide a large program into subparts?

I'm thinking of making a number of (package ....) s out of it.

yours, AJY

Mark Tarver

unread,
Apr 15, 2017, 9:11:25 AM4/15/17
to qil...@googlegroups.com
Generally if I have a really mysterious problem with a file;  I'd just cut it right down and load a stub.   If it loads then add some more of the original code.  Keep going until it falls over and then at least you have an idea of where the problem is.  Is it invariant of the code added?   Then it's probably a length issue.  If not, you'll have a handle on where the problem is.

It's a tedious approach but it works and sometimes you need to do it.  Your program does not load and I do not know why.   If there is really a kernel issue here, it would be good to know.

It would take an hour of my time to debug it.  I might do this for interest this evening, but the sun has appeared.  It's England in April and I want to enjoy it. See you later.

Mark 

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+unsubscribe@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.
Visit this group at https://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.

Antti Ylikoski

unread,
Apr 15, 2017, 10:35:08 AM4/15/17
to Shen
I think I have a fairly good idea where the problem is; but it is a longer story, I need to write a file about the point.

ENJOY YOUR EVENING!!

yours, AJY
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.

Neal Alexander

unread,
Apr 15, 2017, 5:55:14 PM4/15/17
to Shen
Sbcl crashes if I load my current project using a single load statement. It's something like 7kloc iirc. Works fine when split though.

The heap also exhausts if you create a sequent datatype with 100+ rules. Splitting them into smaller pieces works fine though.

Neal Alexander

unread,
Apr 24, 2017, 10:52:42 AM4/24/17
to Shen
The SBCL port of Shen doesn't handle non-ascii characters correctly. The input line prints fine in the terminal, but the output string is mangled and does weird things when you try to highlight it with a mouse in a windows cmd terminal.

(6-) (output "──────────")
ÄÄÄÄÄÄÄÄÄÄ"ÄÄÄÄÄÄ"

Mark Tarver

unread,
Apr 24, 2017, 12:23:16 PM4/24/17
to Shen
Non-standard ASCII (> code point 127) is actually outside the spec; the SP build handles some non-ASCII characters up to extended ASCII (255).

Mark

Bruno Deferrari

unread,
Apr 26, 2017, 5:15:15 PM4/26/17
to qil...@googlegroups.com
Neal, one option you have here is to override the `pr` function so that instead of writing the string byte by byte to the output stream, it uses a native function to write strings instead. I may do it for the next release of the SBCL port, but if you do it first in your fork feel free to submit a pull request.

Will probably document this on the wiki after the next release, because it also helps with port performance.

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+unsubscribe@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.

Visit this group at https://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.



--
BD
Reply all
Reply to author
Forward
0 new messages