Open hakank opened 2 years ago
An consequence of this is that for larger outputs, Picat throws a buffer overflow error (atom too long
):
Picat> bp.shell(X,"ls -latr")
X = total 191Picat> bp.shell(X,"ls -latr")
X = total 19132
-rwxrwxr-x 1 hakank hakank 20075 okt 12 18:03 Makefile.mingw64
-rwxrwxr-x 1 hakank hakank 20391 okt 12 18:03 Makefile.mac64
...
drwxrwxr-x 7 hakank hakank 12288 okt 14 08:06 .
-rwxrwxr-x 1 hakank hakank 4842688 okt 14 08:06 picat
drwxrwxr-x 7 hakank hakank 4096 okt 14 08:08 ..
Stack+Heap: 64,000,000 bytes
Stack in use: 3,040 bytes
Heap in use: 66,096 bytes
...
atom too long
When running as a program, the error is:
$ picat genutils_test1.pi
*** buffer overflow detected ***: picat_genutils terminated
The following is unexpected: the output value
X
is an atom, not a string.Here's a simple query in the
emu
directory, testing ifX
is an atom or a string:I expected that it would be a string.
A fix (on the Picat level) is: