I'm experiencing RunLoop.run
hanging on ppol
in a containerized Linux environment. Swift version doesn't appear to be a factor (I tried as far back as 5.8). It's such a basic example, I'm suprised it's not working and that I must be missing something obvious. Does this example hang for anyone else?
FROM swift:latest
WORKDIR /workspace
RUN swift package init --name Example --type executable
RUN echo "import Foundation" > Sources/main.swift
RUN echo "print(\"BEGIN\")" >> Sources/main.swift
RUN echo "RunLoop.current.run(until: Date(timeIntervalSinceNow: 1))" >> Sources/main.swift
RUN echo "print(\"END\")" >> Sources/main.swift
RUN swift build
ENTRYPOINT [".build/debug/Example"]
Output:
BEGIN
<hang>
Thread dump:
* thread #1, name = 'RunLoopHang', stop reason = signal SIGSTOP
* frame #0: 0x0000ffff94d210c8 libc.so.6`ppoll + 184
frame #1: 0x0000ffff95bc1740 libFoundation.so`__CFRunLoopServiceFileDescriptors + 104
frame #2: 0x0000ffff95bbd524 libFoundation.so`__CFRunLoopRun + 1016
frame #3: 0x0000ffff95bbceac libFoundation.so`CFRunLoopRunSpecific + 476
frame #4: 0x0000ffff95b44d44 libFoundation.so`Foundation.RunLoop.run(until: FoundationEssentials.Date) -> () + 156
frame #5: 0x0000aaaac2ec10f0 RunLoopHang`RunLoopHang_main at main.swift:3:17
frame #6: 0x0000ffff94c684c4 libc.so.6`___lldb_unnamed_symbol3097 + 116
frame #7: 0x0000ffff94c68598 libc.so.6`__libc_start_main + 152
frame #8: 0x0000aaaac2ec0cf0 RunLoopHang`_start + 48
thread #2, name = 'RunLoopHang', stop reason = signal SIGSTOP
frame #0: 0x0000ffff94d2bd74 libc.so.6`epoll_pwait + 148
frame #1: 0x0000ffff95efd024 libdispatch.so`_dispatch_event_loop_drain + 64
frame #2: 0x0000ffff95ef1fdc libdispatch.so`_dispatch_mgr_invoke + 124
frame #3: 0x0000ffff95ef1f50 libdispatch.so`_dispatch_mgr_thread + 132
frame #4: 0x0000ffff95ef578c libdispatch.so`_dispatch_worker_thread + 432
frame #5: 0x0000ffff94cc597c libc.so.6`___lldb_unnamed_symbol3477 + 892
frame #6: 0x0000ffff94d2ba4c libc.so.6`___lldb_unnamed_symbol3850 + 12
Docker version 27.4.0, build bde2b89
macOS 15.2