Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Process] Avoid calling fclose on an already closed resource#45103
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -47,7 +47,9 @@ public function __construct($input) | |||
public function close() | |||
{ | |||
foreach ($this->pipes as $pipe) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
let's remove the foreach completly, php will cleanup handles automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Not removing foreach completely then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
not being too smart is usually safer :P
Thank you@Seldaek. |
I got this in Composer while interrupting an install process with Ctrl-C.
I am assuming it's due to a process which was not closed properly, which is very likely given we run a bunch of them concurrently.. It's pretty hard to debug as it's also hard to reproduce, so I am not sure what to do except handle this case gracefully in the close/__destruct function and hope that at least lets it clean up processes without crashing this way.