Repository navigation
Fix user client leak: terminate instance on clientClose - #194
Closed
totemofwolf wants to merge 1 commit into
Closed
totemofwolf wants to merge 1 commit into
totemofwolf wants to merge 1 commit into
Conversation
AMDRyzenCPUPMUserClient never implemented clientClose, so the default IOUserClient::clientClose (kIOReturnUnsupported) left every instance alive after the connection closed or the client process exited. Opening/closing the connection repeatedly (e.g. status polling every 2s) accumulated dead user clients until IOServiceOpen failed permanently (observed: 1000+ zombies under one provider after ~35 minutes of 2-second polling). Implement clientClose() to terminate the instance, matching the canonical IOUserClient pattern.
Owner
|
I need to hear your reasoning and review of the code. Not from AIs. |
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.
Problem
AMDRyzenCPUPMUserClientnever implementsclientClose(). The defaultIOUserClient::clientClosereturnskIOReturnUnsupported, so the connection object is never terminated — everyIOServiceOpen/close cycle (or every client process exit) leaks one user client instance.Once enough instances pile up, the provider stops accepting new clients and
IOServiceOpenfails permanently for every process until reboot.Observed in the wild
Polling a status CLI every 2 seconds for ~35 minutes accumulated 1000+ zombie
AMDRyzenCPUPMUserClientinstances under a single provider (visible viaioreg -rc AMDRyzenCPUPMUserClient), after whichIOServiceOpenfailed for all processes. Only a reboot clears them.Fix
Implement
clientClose()the canonical way:terminate()the instance and returnkIOReturnSuccess.stop()already cleans upfProvider.Testing
ioreg