Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromSeldaek:patch-24
Jan 24, 2022

Conversation

Seldaek
Copy link
Member

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix #...
LicenseMIT
Doc PRsymfony/symfony-docs#...

I got this in Composer while interrupting an install process with Ctrl-C.

PHP Fatal error:  Uncaught TypeError: fclose(): supplied resource is not a valid stream resource in /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php:50Stack trace:#0 /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php(50): fclose()#1 /var/www/composer/vendor/symfony/process/Pipes/UnixPipes.php(50): Symfony\Component\Process\Pipes\AbstractPipes->close()#2 [internal function]: Symfony\Component\Process\Pipes\UnixPipes->__destruct()#3 {main}  thrown in /var/www/composer/vendor/symfony/process/Pipes/AbstractPipes.php on line 50

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.

@carsonbotcarsonbot added this to the4.4 milestoneJan 21, 2022
@SeldaekSeldaek changed the titleAvoid calling fclose on an already closed resource[Process] Avoid calling fclose on an already closed resourceJan 21, 2022
@@ -47,7 +47,9 @@ public function __construct($input)
public function close()
{
foreach ($this->pipes as $pipe) {

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

Copy link
MemberAuthor

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?

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

derrabus reacted with thumbs up emoji
@nicolas-grekas
Copy link
Member

Thank you@Seldaek.

@nicolas-grekasnicolas-grekas merged commit859d4a1 intosymfony:4.4Jan 24, 2022
This was referencedJan 28, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
4.4
Development

Successfully merging this pull request may close these issues.

3 participants
@Seldaek@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp