| 22 Dec 2025 |
Randy Eckenrode | It might be possible to do it with kqueue. That’s how Apple implements poll in XNU. They probably don’t support devices because it’s not required. | 16:02:58 |
Ihar Hrachyshka | qemu defines fd array as GPollFD poll_fds[1024 * 2]; /* this is probably overkill */ which AFAIU is above the limit on darwin. but then it's probably not something that would be solved by reducing the size of the array since - I assume - qemu has a good reason to listen on so many files (is it because of how nix store is overlayed into these vms?) | 16:04:40 |
Randy Eckenrode | Does it work if the fd limit is increased? | 16:05:31 |
Ihar Hrachyshka | maybe I should (somehow) map fds opened by the process to actual files and see what's in the top | 16:05:43 |
Ihar Hrachyshka | can one increas the limit? thought it's hardcoded in includes and darwin enforces it (which I think is how I get the traceback in Console in the first place) | 16:06:15 |
Ihar Hrachyshka | the traceback with enforcement
Thread 13 Crashed:
0 libsystem_kernel.dylib 0x1903409f4 os_fault_with_payload + 8
1 libsystem_kernel.dylib 0x190348964 __darwin_check_fd_set_overflow + 212
2 libglib-2.0.0.dylib 0x10790fc64 g_poll + 196
3 qemu-system-aarch64 0x104df8158 main_loop_wait + 336
4 qemu-system-aarch64 0x104750064 qemu_main_loop + 96
5 qemu-system-aarch64 0x104d2c06c qemu_default_main + 36
6 qemu-system-aarch64 0x104de5300 qemu_thread_start + 132
7 libsystem_pthread.dylib 0x190374c08 _pthread_start + 136
8 libsystem_pthread.dylib 0x19036fba8 thread_start + 8
| 16:13:33 |
Ihar Hrachyshka | also in the VM (that still runs but is not responsive) sometimes I can see klogs suggesrting hanging tasks like jbd2/vda or journald suggesting writing to disk is blocked. which is why I suspect storage. | 16:18:01 |
Randy Eckenrode | Oh, FD_SET overflow. I was thinking of the limit of number of open fds. | 16:23:34 |