Tcl Source Code

View Ticket
Login
Ticket UUID: e99187025f9687eb9c2a6f2066f2e97dcd040cd0
Title: socket-2.12 fails on OpenBSD: the server child runs out of memory
Type: Bug Created on: 2026-10-14 16:25:49
Submitter: serhiy.storchaka Assigned to: jan.nijtmans
Subsystem: 27. Channel Types Severity: Minor
Priority: 5 Medium Last modified: 2026-10-18 20:24:50
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-10-18 20:24:50
Version: 9.1.0
Description:

socket_inet-2.12 and socket_inet6-2.12 fail on OpenBSD 7.9: the child process (the server) dies with "unable to alloc 4168 bytes" and leaves a core file of 1.6 GB, which can fill /tmp.

The server writes lines of 720000 bytes to a non-blocking socket in a loop, with after 0, until [chan puts] fails after the client closed the connection. With unread data in the client's receive buffer, OpenBSD reports the error to the writer only after about 5 seconds (FreeBSD after 0.05 s, Linux immediately). Meanwhile all the data is queued in memory, until the process exceeds its data size limit.

This is a problem of the test, not of the socket channel: the error is reported correctly when it comes.

Proposed fix in branch test-socket-2.12-openbsd: the server does not queue more data while the previous line is not sent yet.

User Comments:
jan.nijtmans added on 2026-10-18 20:24:50:

Fixed in [03198ed31cf64020|trunk], backported to core-9-0-branch

Many thanks!