Skip to content
Tcl Source Code Artifact [d3312ed138]
Login

Artifact [d3312ed138]

Artifact d3312ed138bb802f874048bae0ae9d4f02d6b05b4e65407fae2dfe6dfaf988ac:

Ticket change [d3312ed138] - New ticket [7586dbc9f53aad9e|7586dbc9f5] <i>fconfigure -sockname fails with &quot;invalid argument&quot; after a failed async connect</i>. by serhiy.storchaka on 2026-10-28 11:40:57.
D 2026-10-28T11:40:57.507
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment After\san\sasync\sconnect\shas\sfailed,\s<tt>fconfigure\s-sockname</tt>\scalls\s<tt>getsockname()</tt>\son\sthe\sfailed\ssocket.\sOn\sDragonFly\sthis\sfails\swith\sEINVAL,\sso\sit\sraises\s<tt>can't\sget\ssockname:\sinvalid\sargument</tt>.\sOn\sother\ssystems\sit\sreturns\swhatever\sthe\ssystem\sreports\sfor\sthe\sdead\ssocket.\s<tt>-peername</tt>\sraises\s<tt>can't\sget\speername</tt>\sin\sthe\ssame\scase.\n\nThis\smakes\ssocket-14.17\sfail\sintermittently\son\sDragonFly\s6.4:\sif\sboth\s<tt>::1</tt>\sand\s<tt>127.0.0.1</tt>\sare\srefused\sbefore\s<tt>fconfigure</tt>\sruns,\sthe\sconnect\sis\sno\slonger\spending.\sA\sloop\sof\s<tt>socket\s-async\slocalhost\s$closedport</tt>\sfollowed\sby\s<tt>fconfigure\s-sockname</tt>\sfailed\s144\stimes\sin\s2000\siterations\son\s8.6\sand\s9.0\sand\s120\stimes\son\s9.1\sin\sone\ssession,\sand\s1\sto\s4\stimes\sin\s2000\sin\sanother.\n\nAlso,\sin\ssocket\stest\smode\s(<tt>testsocket\stestflags\s$s\s1</tt>),\s<tt>fconfigure\s-sockname</tt>\sor\s<tt>-peername</tt>\son\sa\spending\sasync\ssocket\sdereferences\sa\sNULL\s<tt>errorCodePtr</tt>\sin\s<tt>WaitForConnect()</tt>\sand\scrashes.
J foundin 8.6.18,\s9.0.5,\s9.1.0
J login serhiy.storchaka
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter serhiy.storchaka
J subsystem 27.\sChannel\sTypes
J title fconfigure\s-sockname\sfails\swith\s"invalid\sargument"\safter\sa\sfailed\sasync\sconnect
J type Bug
K 7586dbc9f53aad9e461dc547c1e83de06bd1382b
U serhiy.storchaka
Z 9fbb3bd2f06eb8480a9472f63a9931cc