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

[Windows Release] Bad state: StreamSink is bound to a stream #46

Open
VergeDX opened this issue May 24, 2021 · 7 comments
Open

[Windows Release] Bad state: StreamSink is bound to a stream #46

VergeDX opened this issue May 24, 2021 · 7 comments

Comments

@VergeDX
Copy link

VergeDX commented May 24, 2021

In windows release build, I noticed a wierd behavior: The first Future of await Shell().run() will stuck in waiting status.
But later Future of await Shell().run() can be done, but throws the Exception: Bad state: StreamSink is bound to a stream...
I make a demo for reproduce this bug: https://github.com/VergeDX/untitled/tree/demo

I'm using Flutter 2.0.6 (installed by choco), I also tried Flutter 2.2.0. But the bug still here.
I'm a noob for Flutter and English, If any information needed, please let me know.

@savy-91
Copy link

savy-91 commented Jun 21, 2021

I am having the very same issue, it happens only when running the .exe from flutter build. Running the app using flutter run --release does not present the bug.

@alextekartik
Copy link
Contributor

Sorry I did not notice the issue. @VergeDX I cannot access your demo.

@savy-91 do you have some logs (yes I know logs could painful in release but sometimes print is a good debug options). Good if you can catch the exception and display the stacktrace.

@savy-91
Copy link

savy-91 commented Jun 21, 2021

I just verified and the same issue happens when building an .exe using flutter build windows --debug

So far the only exception I was able to catch was the one described above Bad state: StreamSink is bound to a stream. The first time Shell().run() is called though I get no exception.

If you have a Gitlab account @alextekartik I can share the source I am working on. It's a very simple project, not much more than a minimum reproducible example.

@savy-91
Copy link

savy-91 commented Jun 21, 2021

@VergeDX
Copy link
Author

VergeDX commented Jun 21, 2021

Oh sorry, I delete my demo repo because I switch to Process class in dart:io.
I originally thought that this repo isn’t being maintained... thanks for your reply.

@alextekartik
Copy link
Contributor

@VergeDX No problem, I understand, process_run is just a wrapper around dart:io with some convenient helper regarding the environment and script command.

@savy-91 Thanks for the repo, I was able to reproduce. Indeed puzzling and I was able to reproduce the issue just by calling stdout.flush(). And calling it twice on Windows release (build) mode hangs... I guess this should be reported to the flutter team.
So the workaround I added is to remove calls to flush in windows release mode, which should not impact the behavior (it was in place to avoid having console output later). Can you try to update to process_run v0.12.1+1 just published?

@iveoles
Copy link

iveoles commented Jul 28, 2023

I'm currently running 0.13.1 and also getting this same error when running either Debug or Release from the .exe files.

Running flutter build windows will work fine and the .exe version logs that error.

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

4 participants