Open peschue opened 2 years ago
JFI, here's a small testcase:
$ cat | scryer-prolog -f --no-add-history | cat
[user].
comp(1).
comp(2).
end_of_file.
comp(W).
Pressing Enter
on the last line will break 168d1c578909dc143ba52dbed661c36e76b12b36 (from https://hydra.nixos.org/build/186250071#tabs-summary) right after the first answer:
W = 1thread 'main' panicked at 'failed to enable raw mode: IoError(Os { code: 25, kind: Uncategorized, message: "Inappropriate ioctl for device" })', src/machine/system_calls.rs:82:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I've already found #739 and cl-psoatransrun
, will take a look at them now.
Discussed in https://github.com/mthom/scryer-prolog/discussions/1413
I encountered a crash when communicating without a TTY via STDIN/STDOUT.
I have created a minimal package for reproducing the problem: reproduce.tar.gz
When you run
this will build a docker container based on the scryer-prolog container plus python3 and run the reproduce.py script and cause the following messages
The script consults a file, which yields "true." followed by posing a query "foo(X)." and while reading the query result the problem happens.
I think scryer-prolog tries to do something that can only be done with a TTY because the script tries to read until the end of output.
Unfortunatley I was not able to reproduce this just on the shell, because it requires waiting for output before sending additional input.