sb-posix termios support is broken on FreeBSD, NetBSD, and possibly other platforms

Bug #1500951 reported by Alastair Bridgewater
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Undecided
Unassigned

Bug Description

In 1.2.15.79, but the obvious issue dates back to 0.9.17.13, and the subtle issue even further.

First, and most obvious issue: SB-POSIX:CFSETOSPEED treats the TERMIOS structure parameter as optional, but the defined semantic is to mutate an existing TERMIOS structure. It then clears most of the TERMIOS fields to zero, but should be preserving most of them as-is. The bare minimum fix here should be to add a couple of calls to TERMIOS-TO-ALIEN to CFSETISPEED and CFSETOSPEED, but this leads to the more subtle issue below.

Second, more subtle issue: Some systems apparently don't store the input or output speeds in any of the standard fields in the termios structure, which is allowed because the defined methods for manipulating the speeds are cfsetospeed() and friends and the defined fields are declared as a minimum set. SB-POSIX does not preserve any of the non-standard fields, thus will not work correctly on such systems.

And this applies to cfsetispeed(), cfgetispeed(), and cfgetospeed() as well.

Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Fix for the more obvious issue committed as 1.2.16.183.

The "more subtle" issue has been confirmed to affect FreeBSD and NetBSD (as the first two systems that I checked). This is still not fixed.

Changed in sbcl:
status: New → Fix Released
Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Partial fix released, but it's still broken on many non-linux platforms, including FreeBSD and NetBSD.

Changed in sbcl:
status: Fix Released → Triaged
summary: - sb-posix termios support is broken
+ sb-posix termios support is broken on FreeBSD, NetBSD, and possibly
+ other platforms
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.