trealla: number_chars/2 corrupts memory
Corruption is manifested by altering the variable names in answer substitutions.
ulrich@gupu:/tmp$ cat n0.pl
:- use_module(library(clpz)).
:- set_prolog_flag(double_quotes,chars).
g([A,B,C,D]) :-
member(A,"abcdefxABCDEF0"),
member(B,"0123456789abcdefxABCDEFX 'n"),
member(C,"0123456789abcdefxABCDEFX 'n"),
member(D,"0123456789abcdefxABCDEFX '").
chs(Chs) :-
g(Chs),
catch(number_chars(_,Chs), error(_,_), Bad=true),
( Bad = false -> halt ; true ),
Chs = ['F','A'|_].
ulrich@gupu:/tmp$ /opt/gupu/new-trealla/tpl -f n0.pl -g 'chs(Chs).'
Chs = "FA00"
; ... % press a
; Chs = "FAEF"
; Chs = "FAEX"
; Chs = "FAE "
; = "FAE'"
; = "FAF0"
...
So out of a sudden, the name for variable Chs vanishes
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 31 (15 by maintainers)
Commits related to this issue
- number_chars/2 memory corruption, re issaue #816 — committed to trealla-prolog/trealla by infradig a year ago
- number_chars/2 segfault, re issaue #816 — committed to trealla-prolog/trealla by infradig a year ago
- number_chars/2 ignore var processing, re issaue #816 — committed to trealla-prolog/trealla by infradig a year ago
- number_chars/2 ignore atom processing, re issaue #816 — committed to trealla-prolog/trealla by infradig a year ago
Now:
It now runs to the end (for me)…