Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: "fatal error: PowerRegisterSuspendResumeNotification failure" when running in Windows docker containers [1.12 backport] #36377

Closed
dmitshur opened this issue Jan 3, 2020 · 3 comments

Comments

@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jan 3, 2020

Issue #35447 should be considered for backport to the next 1.12 minor release.

@dmitshur dmitshur added this to the Go1.12.15 milestone Jan 3, 2020
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 3, 2020

Change https://golang.org/cl/213198 mentions this issue: [release-branch.go1.12] runtime: do not use PowerRegisterSuspendResumeNotification on systems with "program time" timer

@dmitshur

This comment has been minimized.

Copy link
Member Author

@dmitshur dmitshur commented Jan 3, 2020

Approving this cherry-pick because this is a serious issue without a viable workaround. It is also being approved for 1.13 in issue #35746.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 3, 2020

Closed by merging e42221d to release-branch.go1.12.

@gopherbot gopherbot closed this Jan 3, 2020
gopherbot pushed a commit that referenced this issue Jan 3, 2020
…eNotification on systems with "program time" timer

Systems where PowerRegisterSuspendResumeNotification returns ERROR_
FILE_NOT_FOUND are also systems where nanotime() is on "program time"
rather than "real time".  The chain for this is:

powrprof.dll!PowerRegisterSuspendResumeNotification ->
  umpdc.dll!PdcPortOpen ->
    ntdll.dll!ZwAlpcConnectPort("\\PdcPort") ->
      syscall -> ntoskrnl.exe!AlpcpConnectPort

Opening \\.\PdcPort fails with STATUS_OBJECT_NAME_NOT_FOUND when pdc.sys
hasn't been initialized. Pdc.sys also provides the various hooks for
sleep resumption events, which means if it's not loaded, then our "real
time" timer is actually on "program time". Finally STATUS_OBJECT_NAME_
NOT_FOUND is passed through RtlNtStatusToDosError, which returns ERROR_
FILE_NOT_FOUND. Therefore, in the case where the function returns ERROR_
FILE_NOT_FOUND, we don't mind, since the timer we're using will
correspond fine with the lack of sleep resumption notifications. This
applies, for example, to Docker users.

Updates #35447
Updates #35482
Fixes #36377

Change-Id: I9e1ce5bbc54b9da55ff7a3918b5da28112647eee
Reviewed-on: https://go-review.googlesource.com/c/go/+/208317
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/213198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.