Skip to content

PDP-11 "Sockets: read error 9 - Bad file descriptor" on telnet logout with VH line set to HANGUP #529

@Terri-Kennedy

Description

@Terri-Kennedy

On a Raspberry Pi 5 with 64-bit Bookworm running (locally compiled) Open-SIMH 6e9324e PDP-11, I have the simulator .ini script set up with:

;
; Set up the emulated DHU11 multiplexor    
set vh lines=16
set vh dhu
set vh modem
set vh hangup
set vh enable
attach vh 4000

On the PDP-11 OS side, I am running RSTS/E V10.1 with the relevant terminal lines set like this:

set terminal kbh0:/permanent/noautobaud/dialup/speed=19200

The Telnet client in both cases was a FreeBSD system named gate.

On logout from RSTS/E, the following is displayed:

Telnet session output:

$ bye
Saved all disk files on SY: 3808 blocks in use
Job 7 User 20,254 logged off KB17: at 14-Feb-26 06:13 PM
System RSTS V10.1-L SPC11D - 11/70
Run time was 0 seconds
Elapsed time was 1 minute
Good evening

Line hangup

Disconnected from the PDPConnection closed by foreign host.
gate:~terri# 

Console output:

>>>>>>>>>>>>>>>  OMS V10.1-A  14-Feb-26 06:13 PM  <<<<<<<<<<<<<<<
Message 12 from LOGOUT, user [0,0] on _KB17:, job 7
    LOGOUT terminating [20,254] on dial-up line KB17:
Sockets: read error 9 - Bad file descriptor

There are two issues here.

The first is the cosmetic missing CR/LF between "Disconnected from the PDP" and "Connection closed by foreign host". "Disconnected from the PDP" is likely also redundant as Open-SIMH is already reporting "Line hangup".

The second is the "Sockets: read error 9 - Bad file descriptor" which is being sent to the window where Open-SIMH was launched and is also the RSTS/E system console. This is definitely coming from Open-SIMH as RSTS/E has no 'file descriptor' naming convention for its files. Aside from being cosmetic, I'm concerned that this will cause Open-SIMH to either leak FDs or memory over time.

SIMH (presumably GitHub SIMH) V4.0-0 Current + REALCONS as supplied with the PiDP-11 distribution does not emit the "Disconnected from the PDP", only "Line hangup" and also does not emit the "bad file descriptor" error. So this appears to be a post-SIMH-split issue:

Telnet session output:

$ bye
Saved all disk files on SY: 3728 blocks in use
Job 8 User 20,254 logged off KB17: at 14-Feb-26 06:06 PM
1 other user still logged in under this account
System RSTS V10.1-L RSTS/E V10.1
Run time was 1 second
Elapsed time was 0 minutes
Good evening

Line hangup
Connection closed by foreign host.
gate:~terri# 

Console output:

>>>>>>>>>>>>>>>  OMS V10.1-A  14-Feb-26 06:06 PM  <<<<<<<<<<<<<<<
Message 8 from LOGOUT, user [0,0] on _KB17:, job 8
        LOGOUT terminating [20,254] on dial-up line KB17:

Remote access to both emulators is available if you need it to debug the issue. Alternatively, I can provide the .ini file and the RSTS/E disk image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions