You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IO.Process.run throws an error on non-UTF8 stdout or stderr. #14003
defmain(_args : List String) : IO Unit := do
IO.println s!"Testing IO.Process.run bad_stderr2.c"let spawnArgs : IO.Process.SpawnArgs := { cmd := "./a.out", args := #[] }
let _ ← IO.Process.run spawnArgs
Run the Lean code with lean --run Test.lean.
Expected behavior:
To return with no error.
Actual behavior:
Throws an error:
Uncaught exception: Tried to read from handle containing non UTF-8 data.
Versions
Lean 4.32.0-nightly-2026-06-10
Linux
Additional Information
None
Impact
IO.Process.run only works when stdout and stderr are valid UTF8.
If it were fixed, then it could be used to run programs that print arbitrary
binary data to stdout or stderr.
Solution: have a IO.Process.binOutput and IO.Process.BinOutput that work with byte arrays. Then, have IO.Process.run work on top of that, so that no string
conversion happens at all.
Activity
fix: `IO.Process.output` deadlock and errors thrown while the child runs
fix: `IO.Process.output` deadlock and errors thrown while the child runs
fix: process input and output handling (leanprover#16360)