-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
GetLastError() fails. #189
Comments
I've noticed this too, although I wasn't smart enough to try setting an error to confirm this. @dcharkes this might potentially be an FFI issue if other calls overwrite the thread last error value? https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror |
That was my initial thought too! node-ffi has the same problem too node-ffi/node-ffi#261. Do you think we should report this to the dart-lang team? I have tried to figure out where this might happen... Here they call SetLastError |
Hey! This is a known issue.
Yes it is. Any thread local storage can be clobbered by other calls happening in the mean time. (E.g. the VM might do a garbage collection or something else and call OS API's in the mean time.) We're tracking this on dart-lang/sdk#38832. |
Should we close this issue then, since it has nothing to do with this lib? Maybe add something to README so people know about this? |
We'd better hide the |
In this simple example GetLastError() returns 0 although it should return 100. I might do something wrong here.
This could be related to how ffi works in terms of calling native functions.
The text was updated successfully, but these errors were encountered: