Repository navigation
Don't raise SIGPIPE when sending on a defunct NTP socket - #6
Merged
Merged
Conversation
iOS defuncts the sockets of a suspended app. If a query's socket was opened before a suspension and its write callback runs after the resume, CFSocketSendData fails with EPIPE, and without SO_NOSIGPIPE the kernel kills the host app. Loop was killed this way twice in one morning, seconds after background resumes. With the flag the send returns an error, which the existing failure path already handles.
ps2
added a commit
to LoopKit/LoopWorkspace
that referenced
this pull request
Nov 21, 2026
A write to a socket the server had closed raised SIGPIPE and killed Loop (LoopKit/TrueTime.swift#6).
2 of 3 tasks
ps2
added a commit
to LoopKit/LoopWorkspace
that referenced
this pull request
Dec 1, 2026
…outService, MinimedKit, MedtrumKit, LibreTransmitter and TrueTime.swift; add GlookoService (#595) * Bump Loop and OmnipodKit for watch plugin loading Loop: the watch app loads its CGM kit at run time (LoopKit/Loop#2693), and HealthKit authorization no longer blocks the main thread (LoopKit/Loop#2684). OmnipodKit: the watch can load OmnipodKit at run time (loopandlearn/OmnipodKit#225). * Bump G7SensorKit for run-time watch loading and early control notifications The watch loads G7SensorKit at run time (LoopKit/G7SensorKit#110), which the Loop watch app change in LoopKit/Loop#2693 depends on. Control notifications are enabled before authentication when eavesdropping (LoopKit/G7SensorKit#126). * Bump G7SensorKit to include run-time watch loading The previous bump stopped at LoopKit/G7SensorKit#126; next-dev's tip is LoopKit/G7SensorKit#110, which the Loop watch app change depends on. * Bump TrueTime.swift to ignore SIGPIPE on its sockets A write to a socket the server had closed raised SIGPIPE and killed Loop (LoopKit/TrueTime.swift#6). * Add GlookoService Adds Nutcasey/GlookoService at 459dc9d as a submodule, its project to the workspace and GlookoServiceKitPlugin to the LoopWorkspace scheme. * Bump G7SensorKit, LoopKit, Loop, TidepoolService and GlookoService - G7SensorKit to c86d9bb: a link that delivered a reading isn't a stopped session (#127), rescan after a 2 s sleep and connect when another app connects (#130), reissue the connect at power-on after a restore (#134), and a new sensor or code from the phone keeps the watch's session (#128) - LoopKit to bf8710f2: a device several controllers use can take a changed configuration in place (#706) - Loop to 60007b90: active services in the Issue Report (#2700) - TidepoolService to 365f124: pump component changes upload as reservoirChange and cannula prime events (#51) - GlookoService to 8349aa0: three alerts instead of twelve, localised text * Bump LoopKit, OmnipodKit, TidepoolService and NightscoutService for component replacement - LoopKit to 4e2b9c50: pump events carry component replacement details (LoopKit/LoopKit#703) - OmnipodKit to 681d4cc: the pod change is described with a ComponentReplacement (loopandlearn/OmnipodKit#224) - TidepoolService to 71cc679: uploads the replacement details instead of decoding raw data (LoopKit/TidepoolService#52) - NightscoutService to 6952920: Site Change notes include the replacement reason (LoopKit/NightscoutService#52) * update Glooko: Add Glooko regions: United States, Canada, Germany and France, improve logging * update Script/define_common to include GlookoService * fix: update Script/define_common for next-dev branches * Bump G7SensorKit for early setup from didConnect, the start-delay reconnect and the link hold LoopKit/G7SensorKit#135 and LoopKit/G7SensorKit#138. * Bump Loop, LoopKit, OmnipodKit, MinimedKit, MedtrumKit, G7SensorKit, LibreTransmitter and TrueTime.swift - Loop, LoopKit, OmnipodKit, MinimedKit and MedtrumKit: the watch shows the current pump reservoir level from pump status (LoopKit/Loop#2706, LoopKit/LoopKit#709, loopandlearn/OmnipodKit#230, LoopKit/MinimedKit#50, LoopKit/MedtrumKit#13) - Loop: reset the Presets icon when a restored preset expires (LoopKit/Loop#2685); watch layout moves up with Active Insulin first (LoopKit/Loop#2670) - LoopKit: the preset ISF preview gets a per-unit quantity (LoopKit/LoopKit#711) - G7SensorKit: a failed sensor shows as a row instead of its raw state name (LoopKit/G7SensorKit#142) - LibreTransmitter: glucose algorithm robustness (LoopKit/LibreTransmitter#66); Libre 2 EU sensors with the new patch info first byte pair (LoopKit/LibreTransmitter#67) - TrueTime.swift: iOS deployment target 15.0 (LoopKit/TrueTime.swift#4) --------- Co-authored-by: marionbarker <marionbarker@earthlink.net>
LucasSHYC
pushed a commit
to LucasSHYC/LoopWorkspace
that referenced
this pull request
Dec 2, 2026
5dc1285f...a9fee6a4 - Discard NTP replies whose round trip exceeds the timeout (LoopKit/TrueTime.swift#5) - Don't raise SIGPIPE when sending on a defunct NTP socket (LoopKit/TrueTime.swift#6) - Update iOS deployment target to 15.0 (LoopKit/TrueTime.swift#4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
iOS defuncts the sockets of a suspended app.
NTPConnectioncreates its UDPCFSocketon its lock queue but sends from the socket's write callback on the main run loop. If the app is suspended between the two, the send after the resume hits a defunct socket, andCFSocketSendDatafails with EPIPE. The socket doesn't setSO_NOSIGPIPE, so the kernel also raises SIGPIPE, which kills the host app.Loop was killed this way twice in one morning. Both times launchd logged
exited due to SIGPIPE | sent by Loop, seconds after a background resume, and left no crash report. The relaunch after the second death was then suspended before the CGM manager started, so Loop missed CGM readings until it was opened.This sets
SO_NOSIGPIPEon the socket right after it's created. A send on a defunct socket now just returns an error, and the existingcomplete(.failure)path retries with a new socket.