mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
2.05k stars 120 forks source link

File I/O leaks #1919

Open UWN opened 1 year ago

UWN commented 1 year ago

ulrich@TU-Wien:/opt/gupu/scryer-prolog$   ulimit -v
200000
ulrich@TU-Wien:/opt/gupu/scryer-prolog$ target/release/scryer-prolog -f
?- repeat,open('/dev/null',read,S),close(S),false.
Segmentation fault (core dumped) % unexpected
   loops. % expected, but not found
UWN commented 1 year ago

More specifically:

ulrich@TU-Wien:/opt/gupu/scryer-prolog$ ulimit -v
200000
ulrich@TU-Wien:/opt/gupu/scryer-prolog$ target/release/scryer-prolog -f
?- use_module(library(between)).
   true.
?- between(1,1000000,N),open('/dev/null',read,S),close(S).
   N = 1, S = '$dropped_value'
;  N = 2, S = '$dropped_value'
;  ...
;  N = 23716, S = '$dropped_value'
;  N = 23717, S = '$dropped_value'
;  Segmentation fault (core dumped)