version: 3.0.5 Reproducer: a.scm: (define (test p) (let loop ((i 0)) (when (< (pk 'i i) 40) (move->fdes p i) (loop (+ 1 i))))) (test (car (pipe)) Run guile -l a.scm. The result is non-deterministic. Output (try #1--#2): ;;; (i 0) [...] ;;; (i 9) Backtrace: In ice-9/boot-9.scm: 1736:10 8 (with-exception-handler _ _ #:unwind? _ # _) In unknown file: 7 (apply-smob/0 #) In ice-9/boot-9.scm: 718:2 6 (call-with-prompt ("prompt") # …) In ice-9/eval.scm: 619:8 5 (_ #(#(#))) In ice-9/boot-9.scm: 2806:4 4 (save-module-excursion #) 4351:12 3 (_) In /home/sylviidae/a.scm: 4:6 2 (test #) In ice-9/ports.scm: 302:9 1 (move->fdes # _) In unknown file: 0 (primitive-move->fdes # 9) ERROR: In procedure primitive-move->fdes: In procedure primitive-move->fdes: Ongeldige bestandsdescriptor Output (try #3): (this time no error) ;;; (i 0) [...] ;;; (i 40) GNU Guile 3.0.5 Copyright (C) 1995-2021 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. Some more debugging. scheme@(guile-user)> (getpid) $1 = 23855 (Shell): ls /proc/23855/fd/ (Shell output) 0 1 10 11 12 13 14 2 3 4 5 6 7 8 9