Save-image / load-image bug?


#1

Hi,
I started playing with uLisp (Arduino nano) – thank you for this fine project. Now I really want to learn lisp… ;-)

I think I found a bug with the (save-image) / (load-image) functions.

Here is a screen capture how to reproduce it:

---------- START of log ----------
uLisp 1.5

316> (defun hi () (print "Hello"))
hi

302> (hi)

"Hello" 
"Hello"

302> (save-image 'hi)
28

302> (load-image)
28

302> (hi)

"Hello" 
"Hello"

302> (save-image)
22

302> (load-image)
22

;;; reset the board

302> uLisp 1.5

;;; image is not loaded, so load it manually:

316> (load-image)
22

01111111111111111111111111111111111111 [many '1's deleted] 111111111111111> 
---------- END of log

Do I use the functions in a wrong way?

Thanks in advice,
regards,
Kaef


#2

You are using the functions correctly, and I can confirm that I can reproduce the problem.

The problem seems to occur when saving images containing strings. Repeating your example with:

(defun hi () (print 'hi))

works fine. Thank you for finding this - I’ll try and release a fix as soon as possible.


#3

Thanks for the response;
I don’t think the problem has to do with strings, because I saw the problem when saving the image with no stringfunctions used.
Yesterday a (maybe?) simular error occured when redefining a function and then save the image.
Maybe it’s a gc failure?
I’ll try to reproduce it and send a log – it seems the error does not always occur.


#4

Yes, you’re right - the problem occurs in other situations too.


#5

The bug is fixed in version 1.5a, released today. Thanks for the help in tracking it down.


#6