Summary

Reading and writing to a pipe set up by process can cause scheduler assertion errors

Metadata

Description

As pointed out in this|StackOverflow post]:

 (use posix)
 (let-values (((in out pid) (process "bc")))
   (begin
     (display "2 + 2\n" out)
     (print (read-line in))))

Causes the following crash when evaluated:

 thread is registered for I/O on unknown file-descriptor: 4 (expected 3)
 [] 
 ...more...
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <syntax>
 <eval>
 <eval>
 <eval>
 <eval>
 <eval>  <--

This bug is not easy to trigger. I happened to get "lucky" and it crashed the first time, but after that I tried again several times and it just worked.

Changes and comments

[2019-06-26 16:13:39 UTC] sjamaan changed milestone from someday to 5.2

[2019-08-25 17:37:02 UTC] felix changed milestone from 5.2 to 5.3

[2021-04-18 11:18:15 UTC] felix changed milestone from 5.3 to 5.4

[2023-11-06 22:10:38 UTC] felix changed milestone from 5.4 to 6.0.0