-
Notifications
You must be signed in to change notification settings - Fork 26
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
Weird bug when mixing futures and redirection #44
Comments
That could the title of a song! ☺ |
@sophiaIC Please send me a playlist with the kind of music where "Weird bug when mixing futures and redirection" is a normal song title :) |
|
Is it still the case with the HEAD of master, 79f29b2? |
This no longer seems to be an issue! I'll close this. |
Is there a test case to prove that this is no longer an issue? |
@supercooldave The two tests touched by the related commit (345f43b) were the ones that needed the workaround. Since we don't know what was causing the issue before, it's hard to write a test that for it, but at least they both work (as well as the example above). |
Good enough. |
The following program runs and prints
Done!
as expected:However, if we redirect
stdout
somewhere, the output disappears:The problem only arises when redirecting
stdout
:The problem goes away if we get rid of the futures:
It also goes away if we add an embedded
fflush
to the end of themain
method:It seems like some buffer for
stdout
is not flushed when the actor performing the print is suspended, waiting for the future to be fulfilled. Flushing in the end of themain
function in the generated C-code (i.e. right before returning fromint main()
) does not fix the problem, so probably some other thread(s) needs to flush it. I'm not going to spend any more time on this until the new futures arrive.The text was updated successfully, but these errors were encountered: