unbounded memory consumption in unclosed [text]

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
hs
Posts: 13
Joined: Sun Sep 03, 2006 8:32 am

unbounded memory consumption in unclosed [text]

Post by hs »

> (println [text]x)
~
ERR: missing end of text [/text]

ok in cli, however, not in .lsp file, try this
(println [text]
x)

or even this (forgot to type '/' in closing [/text])
(println [text]
x[text])

using (string) or (format doesn't help either
(println (string [text]
x))

(println (format [text]
x))

top (on openbsd) shows a crawling but steady consumption of memory, eventually i get not enough memory error message

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: unbounded memory consumption in unclosed [text]

Post by Lutz »

On the command-line input is ended after an [enter], but when loading a program file, whenever an opening '[text]' is encountered, newLISP will keep on reading until and '[/text]' or end-of-file is encountered.

Code: Select all

~$ uname -rs
OpenBSD 4.4
~$ cat test.lsp
(println [text]
x)

~$ ./newlisp test.lsp

ERR: missing end of text [/text]
~$ 
After newLISP has exited with an error message, I can see no further memory usage or newLISP running in the Unix top utility. Same on OpenBSD, FreeBSD and FreeBSD.

hs
Posts: 13
Joined: Sun Sep 03, 2006 8:32 am

Re: unbounded memory consumption in unclosed [text]

Post by hs »

$ more test.lsp
(println [text]
x)
$ date
Tue Nov 3 17:31:28 WIT 2009
$ newlisp test.lsp

ERR: not enough memory
$ date
Tue Nov 3 17:35:17 WIT 2009
$ uname -rs
OpenBSD 4.6
$ dmesg | grep mem
real mem = 1610117120 (1535MB)
avail mem = 1547059200 (1475MB)

it's weird, i got different result ... i'm on openbsd 4.6 i386 on amd64 cpu

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: unbounded memory consumption in unclosed [text]

Post by Lutz »

I see you are running a 64bit system. The OpenBSD machine I was testing was an amd64 too and newLISP was running in the 64bit version. Either newLISP was not compiled adequate, or your OpenBSD system is not configured correctly.

Please answer the following questions:

- what version of newLISP are you running?
- does it say 64-bit in the sign-on line?
- exactly how did you compile newLISP, what were the shell commands?
- did you run 'make test' after making newLISP?

you can also try to make newLISP twice the following way:

$ make -f makefile_bsd
$ make test

and then:

$ make -f makefile_bsdLP64
$ make test

Probably one of them will fail the other will work. Some system are configured for both 32bit and 64bit, then both will work. Also always to a 'make clean' before a new compile.

ps: note that running on a 64bit CPU doesn't necessaryly mean you are running a 64bit. Also running a 64bit OS doesn't necessariy mean you have to run an LP64 memory model. Many 64-bit system run the ILP32 model only, some the other, some are configured for both.

Locked