Artifacts Associated With Ticket d22dc7e9ca
Ticket change [2ca2c53187] (rid 257679) by serhiy.storchaka on 2026-10-12 08:41:35:
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
On illumos (OpenIndiana), a non-blocking <code>connect()</code> to a local listener succeeds at once instead of returning EINPROGRESS; on DragonFly this happens for IPv6 (<code>::1</code>). <code>TcpConnect()</code> makes the socket non-blocking for <code>socket -async</code> but restores the blocking mode only when the connect finishes in the background. So after such an immediate connect the socket stays non-blocking while the channel is blocking, and a blocking <code>gets</code> returns an empty string at once. This fails socket-14.7.0 and 14.7.1 on illumos and socket-14.7.1 on DragonFly. This is a regression of [219061] (HP-UX, fixed in 8.3.1 by resetting the socket to blocking mode when the connect succeeds at once). Since the 2011 rework the blocking mode, cached since [3401422], is restored only after a connect finishing in the background; [3428753] fixed only the flag for connections completing at once. Proposed fix in branch [/timeline?r=unix-async-connect-immediate-success|unix-async-connect-immediate-success].
- foundin initialized to: "9.1.0"
- login: "serhiy.storchaka"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "serhiy.storchaka"
- subsystem initialized to: "27. Channel Types"
- title initialized to:
socket -async leaves the socket non-blocking when the connect succeeds at once
- type initialized to: "Bug"
Ticket change [de82dcfccc] (rid 257680) by serhiy.storchaka on 2026-10-12 08:44:36:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- login: "serhiy.storchaka"
Ticket change [65a92a358d] (rid 257899) by jan.nijtmans on 2026-10-13 12:23:54:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461327.0166012617"
- closer changed to: "jan.nijtmans"
- comment changed to:
On illumos (OpenIndiana), a non-blocking <code>connect()</code> to a local listener succeeds at once instead of returning EINPROGRESS; on DragonFly this happens for IPv6 (<code>::1</code>). <code>TcpConnect()</code> makes the socket non-blocking for <code>socket -async</code> but restores the blocking mode only when the connect finishes in the background. So after such an immediate connect the socket stays non-blocking while the channel is blocking, and a blocking <code>gets</code> returns an empty string at once. This fails socket-14.7.0 and 14.7.1 on illumos and socket-14.7.1 on DragonFly. This is a regression of [219061] (HP-UX, fixed in 8.3.1 by resetting the socket to blocking mode when the connect succeeds at once). Since the 2011 rework the blocking mode, cached since [3401422], is restored only after a connect finishing in the background; [3428753] fixed only the flag for connections completing at once. Proposed fix in branch [/timeline?r=unix-async-connect-immediate-success|unix-async-connect-immediate-success].
- icomment:
Fixed in [6d02d5f8a6|trunk], core-9-0-branch and core-8-6-branch
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"