base: Fix fdReady() potentially running forever on Windows.
ClosedPublic

Authored by nh2 on Sep 14 2017, 8:48 AM.

Details

Summary

This fixes Trac #13497 for Windows -- at least for the if (isSock)
part; I haven't investigated the case where it's not a socket
yet.

Solved by copying the new current-time based waiting logic
from the non-Windows implementation above.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nh2 created this revision.Sep 14 2017, 8:48 AM
bgamari edited edge metadata.Sep 14 2017, 9:55 AM

This looks pretty reasonable to me. The potential for wraparound exists, but I'm not sure we can do much in this case.

bgamari accepted this revision.Sep 14 2017, 9:55 AM
This revision is now accepted and ready to land.Sep 14 2017, 9:55 AM
nh2 added a comment.Sep 14 2017, 12:03 PM

This looks pretty reasonable to me. The potential for wraparound exists, but I'm not sure we can do much in this case.

The wraparound was only possible on Windows < XP which is not supported by GHC any more; see https://phabricator.haskell.org/D3953#110987 for details.

It looks like this currently fails to validate:

ghc.exe: | C:\msys64\var\drydock\workingcopy-41165\repo\glasgow-haskell-compiler\bindisttest\install dir\lib\base-4.10.0.0\HSbase-4.10.0.0.o: unknown symbol `getProcessElapsedTime'
This revision was automatically updated to reflect the committed changes.
nh2 added a comment.Sep 22 2017, 12:12 PM

It looks like this currently fails to validate:

ghc.exe: | C:\msys64\var\drydock\workingcopy-41165\repo\glasgow-haskell-compiler\bindisttest\install dir\lib\base-4.10.0.0\HSbase-4.10.0.0.o: unknown symbol `getProcessElapsedTime'

For my record, this was likely fixed by https://phabricator.haskell.org/D3953#111765