-
Notifications
You must be signed in to change notification settings - Fork 570
os.Read() appears to block other goroutines from executing #529
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
Comments
I have narrowed it down to an apparent deadlock between Go output:
GopherJS output:
Reproduction case:
|
I have narrowed it down to this reproduction case:
|
It seems that |
Yes, this is by the nature of the current implementation of syscalls. They are synchronous/blocking, which is enough for most tests to work fine. |
Is this by design, then, and should be closed? Or is it a long-term to-do item (possibly being tracked elsewhere)? |
It is by design in so far that the syscalls support is not intended for production, but just for being able to run tests. I personally will probably never work on this. However, someone else might. We should mention this restriction on https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md. |
This change works around the issues discussed in #529 by using a temporary file for capturing the stdout of a runnable example, rather than os.Pipe. This allows examples to work in cases where they would previously stall. ioutil.ReadFile and its supporting functions are copied from ioutil into testing, in order to avoid having "testing" package import extra packages that the real "testing" package does not. gopherjs tool testFuncs.load does not take into account the overridden natives, see https://github.com/gopherjs/gopherjs/blob/b9bcb1da229a59cc1e1d168401662cb6450aae08/tool.go#L827. So we still need to print the expected output for the example to pass. Given there are only 2 disabled examples, it's easier to just do this in short term. But it might be good to eventually improve code for overriding natives so that examples are properly overridden as well. Regenerate compiler/natives.
Uh oh!
There was an error while loading. Please reload this page.
In some situation I have yet to specifically identify, GopherJS hangs. I'm creating this issue to track my debugging progress.
I found, while working on #528, that the first example for the upstream 'html/template' package causes a freeze. I have narrowed this down to a stand-alone reproduction case below. But I still need to work on narrowing it down further.
When I execute the following code in Go:
Or in GopherJS:
(and never exits)
The text was updated successfully, but these errors were encountered: