Repository navigation
Make sweeping HSLFileDescriptors a no-op - #9614
Closed
mszabo-wikia wants to merge 1 commit into
Closed
mszabo-wikia wants to merge 1 commit into
mszabo-wikia wants to merge 1 commit into
Conversation
Contributor
|
@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.) |
Wilfred
approved these changes
Jun 23, 2025
Wilfred
left a comment
Contributor
There was a problem hiding this comment.
Makes sense, thanks. Would you mind rebasing this one too?
A trivial CLI program that outputs to stdout, such as this one:
```hack
use namespace HH\Lib\IO;
<<__EntryPoint>>
async function main(): Awaitable<void> {
// var_dump(new Test());
await IO\request_output()->writeAllAsync("Hello World!\n");
}
```
will abort on exit on a dev build of HHVM with the following assertion
failure:
```
hphp/runtime/base/countable.h:285: bool HPHP::MaybeCountable::countedDecRefAndCheck(): assertion `!tl_sweeping' failed.
```
GDB points to HSLFileDescriptor as the culprit:
```
(gdb) bt
msg=...) at /hhvm/hphp/util/assertions.cpp:73
```
HSLFileDescriptor may either be initialized with a raw FD or a req::ptr
holding a File. In the former case, sweeping is already a no-op since
the extension maintains a request-local set of FDs to be closed and
processes it on request shutdown. For the File case, we only ever seem
to pass in builtin files (namely STDOUT and co.), which should likewise
already be closed by BuiltinFile::sweep() /
BuiltinFiles::requestShutdown().
So, define a no-op sweep() for HSLFileDescriptor to avoid triggering
redundant cleanup and the assert.
mszabo-wikia
force-pushed
the
no-sweep-builtins
branch
from
June 23, 2025 14:28
6ed6632 to
d7105ec
Compare
Contributor
|
@mszabo-wikia has updated the pull request. You must reimport the pull request before landing. |
Contributor
Author
|
Done, thanks! |
Contributor
|
This pull request has been merged in f32e428. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A trivial CLI program that outputs to stdout, such as this one:
will abort on exit on a dev build of HHVM with the following assertion failure:
GDB points to
HSLFileDescriptoras the culprit:HSLFileDescriptormay either be initialized with a raw FD or areq::ptrholding aFile. In the former case, sweeping is already a no-op since the extension maintains a request-local set of FDs to be closed and processes it on request shutdown. For theFilecase, we only ever seem to pass in builtin files (namely STDOUT and co.), which should likewise already be closed byBuiltinFile::sweep()/BuiltinFiles::requestShutdown().So, define a no-op sweep() for
HSLFileDescriptorto avoid triggering redundant cleanup and the assert.