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

failing on windows? #21

Closed
narimiran opened this issue Mar 8, 2019 · 3 comments
Closed

failing on windows? #21

narimiran opened this issue Mar 8, 2019 · 3 comments

Comments

@narimiran
Copy link
Contributor

Based on Nim appveyor tests, this package fails on Windows.

I don't have Windows so I cannot reproduce, but I have been told that running nim c tests/teststream.nim produces ..\chronos\transports\stream.nim(287, 27) Error: 'writeStreamLoop' is not GC-safe as it performs an indirect call here/

This is likely connected to nim-lang/Nim@c86b1fb and could probably be fixed on your end by some extra {.gcsafe.} at some places.

@cheatfate
Copy link
Collaborator

Sorry but this is not Chronos bug, but new bug of Nim compiler. This function do not touch any global values which are in GC memory.

Until @Araq will not explain new gcsafe behavior properly in documentation or specification this issue will be closed.

@zah
Copy link
Member

zah commented Mar 9, 2019

@cheatfate, the issue is that the code makes a call through a function pointer, which is not marked with gcsafe. The function pointer type is this one:

WSAPROC_TRANSMITFILE = proc(hSocket: SocketHandle, hFile: Handle,

Since the pointer is not gcsafe, in theory it's possible that a non-gcsafe function is assigned to it, so the compiler has to make the conservative assumption that the caller of the pointer (writeStreamLoop) may not be gcsafe as well.

@cheatfate
Copy link
Collaborator

@zah nim-lang/RFCs#142

@cheatfate cheatfate reopened this Mar 11, 2019
cheatfate added a commit that referenced this issue Mar 13, 2019
cheatfate added a commit that referenced this issue Mar 14, 2019
bung87 pushed a commit to bung87/nim-chronos that referenced this issue Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants