﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
452	mgp_io_.pl1 can hang while attempting and failing to send network mail over Chaosnet	Jim Lippard	Eric Swenson	"While tracking down a hang while attempting and failing to send network mail over Chaosnet (see #448 and #451), the hang itself turned out to be here. The -timeout attach option covers only connection establishment: get_timeout (158–175) stores the value, line 185 arms timer_manager_$alarm_wakeup immediately before the connect, and check_connection_loop (196–208) is the only ipc_$block in the module that tests my_event_wait_info.message against ALARM___ and turns it into error_table_$net_timeout. Line 210 resets the alarm on success and the option is never consulted again. Every subsequent blocking operation — put_chars (399), get_chars (434), get_line (476), position (527), read_record/read_length (570), write_record (598), and the ""eof"" control order's acknowledgement wait (717) — is guarded only by attach_data.no_block and can wait indefinitely. mgp_io_$mgp_io_close reaches line 598 through the EOF write at 351, so even an orderly close of a connection whose peer has gone silent without a CLS never returns. The alarm channel is already in attach_data.wait_list, so a wakeup does break these blocks — the defect is that only one of the eight sites inspects the message.

I hit this with a partially-up Chaosnet connection that wasn't quite working, so it may be difficult to reproduce. The path must be silently discarded, not refused: if the RFC is never answered the attempt dies in mgp_io_$mgp_io_attach, whose own cleanup handler (line 14) nulls the iocb pointers at 111 before mmd_chaos_'s handler runs, so the close never enters this module; and if the peer sends a proper CLS, check_for_disconnect (840) exits cleanly. The hang needs the Chaos layer to still believe the connection is open while having no output window.

io_call attach x mgp_io_ ghm -server mail
io_call open x stream_input_output — confirm the greeting arrives
drop the path at cbridge, or with an IP filter rule that silently discards the traffic
io_call close x

Step 4 should never return, with no CPU accumulating — compare relative CPU in the ready message before and after, which also distinguishes this from #448."	defect	new	major	MR12.10	Networking	MR12.9		mlsys, networking, mgp_io_.pl1, Chaosneet	
