x/sys/windows/svc: goroutine leak on exit path #35953
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Milestone
https://github.com/golang/sys/blob/6d18c012aee9febd81bbf9806760c8c4480e870d/windows/svc/service.go#L248-L279
If the handler send to
changesFromHandler
channel after thebreak loop
due tor.errno != 0
, the handler goroutine and the unbuffered channel will be leaked.I understand that
sysErrNewThreadInCallback
can hardly happen, and it is generally safe to assume that caller will exit aftersvc.Run
returned. This is just a minor issue.Some other places that caught my eyes:
svc.Run
calledos.LockOSThread()
, but does not havedefer os.UnlockOSThread()
service.close()
is not referenced anywhere, and it should be removed becauseCloseHandle
whileWaitForSingleObject
is an undefined behaviorThe text was updated successfully, but these errors were encountered: