ciao icon indicating copy to clipboard operation
ciao copied to clipboard

uncaught memory overflow in ciaowasm (was Cannot distinguish error from failure")

Open Jean-Luc-Picard-2021 opened this issue 2 years ago • 2 comments

There is a strange behaviour on my machine with the new Ciao WASM Playground:

?- time2(fac(s(s(s(s(s(s(s(s(s(s(n)))))))))), _)).
% walltime 520.0 ms
yes
?- time2(fac(s(s(s(s(s(s(s(s(s(s(s(n))))))))))), _)).
no
?- fail.
no

I guess JavaScript WASM run out of memory. But somehow the error is not noticed or ignored. Would it be possible to show the out of memory?

P.S.: Was using this code:

add(n, X, X).
add(s(X), Y, Z) :- add(X, s(Y), Z).

mul(n, _, n).
mul(s(X), Y, Z) :- mul(X, Y, H), add(Y, H, Z).

fac(n, s(n)).
fac(s(X), Y) :- fac(X, H), mul(s(X), H, Y).

Jean-Luc-Picard-2021 avatar Jul 09 '22 08:07 Jean-Luc-Picard-2021

Thanks! This is definitely a bug.

jfmc avatar Jul 09 '22 09:07 jfmc

Looking at values reported by statistics/0 it seems that some memory overflow is not handled correctly.

jfmc avatar Jul 29 '23 14:07 jfmc