#18539 closed bug (fixed)

send(2) with AF_UNIX SOCK_DGRAM blocks upon full send buffer; MSG_NOWAIT ignored

Reported by: kohlschuetter Owned by: axeld
Priority: critical Milestone: R1/beta5
Component: Network & Internet/UDP Version: R1/beta4
Keywords: hang Cc:
Blocked By: Blocking:
Platform: All

Description

When sending datagrams via AF_UNIX, a buffer-full condition prevents "send" from returning immediately with an error, even when MSG_NOWAIT is set.

For comparison, macOS always returns with errno=ENOBUFS in that situation, regardless whether MSG_NOWAIT was set or not. Linux returns with "EAGAIN" only with MSG_NOWAIT set, blocking if not.

This prevents code relying on these features from working as expected.

A workaround is to define a send timeout on the socket, however that may be brittle when receiving an existing socket via file descriptors, for example.

Attachments (1)

sendtest.c (1.0 KB ) - added by kohlschuetter 16 months ago.
Example code demonstrating the bug

Download all attachments as: .zip

Change History (3)

by kohlschuetter, 16 months ago

Attachment: sendtest.c added

Example code demonstrating the bug

comment:2 by korli, 16 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: newclosed

Committed in hrev57200

Note: See TracTickets for help on using tickets.