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
Segfault on Windows when stdout is not a real console handle #124
lambda-term 3.3.3 segfaults on Windows (GitHub Actions windows-latest runner, OCaml 4.14.3) when LTerm.stdout is force-evaluated. This affects utop and anything built on top of it (e.g. Reason's rtop).
Reproduction
On a Windows GitHub Actions runner (or any Windows environment where stdout may not be a real console handle):
echo "1 + 1;;" | utop 2>&1
Output:
OCaml version 4.14.3
Enter #help;; for help.
Segmentation fault
This also happens without piped input — just running utop segfaults.
Environment
OS: Windows (GitHub Actions windows-latest runner)
OCaml: 4.14.3
lambda-term: 3.3.3
utop: 2.16.0
lwt: 6.1.1
Analysis
The crash appears to be in lt_term_get_size_from_fd in lTerm_term_stubs.c:
@davesnx Thanks for your issue report and the associated PR.
But before digging into this issue. Could you please do me a favor that try to downgrade the lwt to version <= 6.0.0 and try utop or other lambda-term depended programs again to see if this issue still exists?
Activity
fix: validate console handles on Windows to prevent segfault
kandu commentedon Mar 6, 2026
@davesnx Thanks for your issue report and the associated PR.
But before digging into this issue. Could you please do me a favor that try to downgrade the lwt to version <= 6.0.0 and try utop or other lambda-term depended programs again to see if this issue still exists?