Skip to content

macOS: send / recv of more than INT_MAX bytes fail with EINVAL #7476

Closed

Description

@NathanSWard

macOS rejects socket send/recv lengths above INT_MAX with EINVAL instead of transferring fewer bytes. Fix: cap the length at INT_MAX on macOS.
Should this be done just for the Socket type or for all send/recv calls is up for discussion.

Activity

  1. added
    Team: Mojo Libraries
    on Nov 4, 2026
  2. self-assigned this
    on Nov 4, 2026
  3. obadafidii commented on Nov 15, 2026

    @obadafidii
    Contributor

    Hi @NathanSWard has this been internally fixed or can I pick this up?

  4. modularbot commented on Nov 19, 2026

    @modularbot
    Collaborator

    The fix, "[stdlib] Share the macOS read and write length cap with sockets", has landed in Modular's internal repository. This issue closed automatically when it landed, before the change is public.

    It will be in the nightly of 20 November 2026 (Mojo 1.3.0.dev2026112005, MAX 26.8.0.dev2026112005) and later builds, and in the next stable releases, Mojo 1.3 and MAX 26.8.

    The commit reaches main here with that nightly's export.

    If you still see the problem in that nightly or later, please comment here and we will reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Team: Mojo Librariesacceptedbug_feature_triaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions