!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1161 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org187 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
29 Dec 2025
@reckenrode:matrix.orgRandy EckenrodeThe only issue I can see with forcing a larger size for all packages is what happens when packages request their own size (e.g., a smaller one).00:42:00
@emilazy:matrix.orgemily

This will not resolve the issue of fds limited to 1024 per se but only
disable the fault trap in libSystem. To increase the number of fds
supported by select, one also has to increase FD_SETSIZE macro value
during compilation, making sure it's defined before select header is
included.

I believe the idea is actually that you pass a heap-allocated fd buffer instead

00:42:21
@emilazy:matrix.orgemilyand then it checks whether it's on the stack or not00:42:34
@ihar.hrachyshka:matrix.orgIhar Hrachyshka...which is what I'm doing in that glib patch (and in the counterpart local to glib package here: https://github.com/NixOS/nixpkgs/pull/474904) but we had a discussion with Randy the other day that maybe there's no practical reason to limit it (BSDs don't)00:42:43
@reckenrode:matrix.orgRandy EckenrodeThe implementation in xnu just disables the check. It doesn’t check location AFAIK.00:43:11
@emilazy:matrix.orgemily POSIX doesn't say FD_SETSIZE has to be 1024, so Apple could raise the default if they wanted to (so perhaps there is a reason they haven't) 00:43:41
@ihar.hrachyshka:matrix.orgIhar Hrachyshka

I believe the idea is actually that you pass a heap-allocated fd buffer instead

interesting. and it rhymes with something we read elsewhere. where do you get this from?

00:43:54
@emilazy:matrix.orgemily one obvious way it can go badly is if people cast their own 1024-size stack buffers to fd_set and then you have a heap overflow vulnerability 00:44:10
@reckenrode:matrix.orgRandy EckenrodeWouldn’t that be a breaking change?00:44:12
@emilazy:matrix.orgemilywell, no more or less a breaking change than if we do it00:44:39
@reckenrode:matrix.orgRandy Eckenrodehttps://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/libsyscall/wrappers/select-base.c#L1000:44:40
@reckenrode:matrix.orgRandy Eckenrode * 00:44:46
@emilazy:matrix.orgemilynominally it should just increase people's stack sizes, but ^ could potentially cause disaster, but then that's a reason it could be bad for us too00:44:59
@reckenrode:matrix.orgRandy EckenrodeBut we’re building everything from source. Apple has to support older binaries.00:45:17
@reckenrode:matrix.orgRandy Eckenrodehttps://devblogs.microsoft.com/oldnewthing/20221102-00/?p=10734300:45:40
@reckenrode:matrix.orgRandy EckenrodeApple is kind of stuck with a crappy ABI it inherited from BSD.00:46:00

Show newer messages


Back to Room ListRoom Version: 6