Fix standard-stream inheritance and platform log chunking - #236
Open
bkaradzic-microsoft wants to merge 2 commits into
Open
Fix standard-stream inheritance and platform log chunking#236bkaradzic-microsoft wants to merge 2 commits into
bkaradzic-microsoft wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Gate or explicitly enable the pipe2 feature declaration for the desktop POSIX test target.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates standard-stream redirection to prevent descriptor inheritance and adds platform-specific diagnostic log chunking with regression coverage.
Changes:
- Preserves descriptor flags while enforcing non-inheritance.
- Adds bounded, UTF-8-aware platform log chunking.
- Expands lifecycle, descriptor, and chunking tests.
File summaries
| File | Summary |
|---|---|
Tests/UnitTests/Shared/StandardStreamLoggerPosix.cpp |
POSIX descriptor tests |
Tests/UnitTests/Shared/StandardStreamLoggerLines.cpp |
Chunking and UTF-8 tests |
Tests/UnitTests/Shared/StandardStreamLogger.cpp |
Lifecycle and preservation tests |
Tests/UnitTests/CMakeLists.txt |
Desktop test registration |
Tests/UnitTests/Android/app/src/main/cpp/CMakeLists.txt |
Android test registration |
Core/Foundation/Source/StandardStreamLoggerLines.h |
Bounded line processing |
Core/Foundation/Source/StandardStreamLogger_Windows.cpp |
Windows inheritance handling |
Core/Foundation/Source/StandardStreamLogger_Shared.inl |
Shared draining and chunk emission |
Core/Foundation/Source/StandardStreamLogger_PosixOps.inl |
POSIX descriptor and pipe handling |
Core/Foundation/Source/StandardStreamLogger_Apple.cpp |
Apple log limits |
Core/Foundation/Source/StandardStreamLogger_Android.cpp |
Android log limits |
Core/Foundation/Include/Babylon/StandardStreamLogger.h |
API documentation |
Core/Foundation/CMakeLists.txt |
Foundation source registration |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Follow up on the review of #233. Make private stream copies non-inheritable, create Android pipes atomically close-on-exec, and preserve target inheritance flags during redirection and restoration. Keep Windows CRT descriptor modes and unavailable GUI streams intact. Apply platform-specific byte limits to complete and partial log lines, including Apple's persisted dynamic-content budgets. Preserve UTF-8 boundaries and CRLF without changing the original-stream tee. Add lifecycle, inheritance, chunking, and POSIX descriptor regression coverage, and document the remaining process-creation synchronization requirement on platforms without atomic primitives. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 88569c10-a7ff-4373-9a58-afa9c68b8c09
Use the checked pipe/fcntl fallback for desktop POSIX tests, avoiding an implicit dependency on GNU pipe2 declarations. Preserve Android's atomic O_CLOEXEC path and clarify the fallback's serialization requirement. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54aaa1e1-b4b3-46e7-9de4-5a56add4ac42
bkaradzic-microsoft
force-pushed
the
fix/standard-stream-logger-followups
branch
from
September 10, 2026 23:37
93857c4 to
9b44d12
Compare
bkaradzic-microsoft
enabled auto-merge (squash)
September 11, 2026 00:12
bkaradzic-microsoft
disabled auto-merge
September 11, 2026 00:13
bkaradzic-microsoft
added a commit
to BabylonJS/BabylonNative
that referenced
this pull request
Sep 11, 2026
Updates the JsRuntimeHost pin from `a6b98eaa1a9887b35adceed21f8c7d44c4f38e43` to `f47991dd5729fac1d6d477e66ed8a843da1d4832`, the latest upstream `main`. Includes BabylonJS/JsRuntimeHost#232: - Dispatches V8 foreground tasks through AppRuntime so asynchronous WebAssembly compilation promises settle instead of hanging. - Shares the delayed-task scheduler between V8 foreground work and the scheduling polyfill, with explicit ownership and shutdown handling. This is a one-line dependency-pin update based on current Babylon Native `master`. The standard-stream logger follow-up, BabylonJS/JsRuntimeHost#236, is still open and is not included in this revision. Co-authored-by: Branimir Karadzic <branimirkaradzic@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 88569c10-a7ff-4373-9a58-afa9c68b8c09
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.
Follow-up to #233, addressing Gary's review.
Changes
F_DUPFD_CLOEXECon POSIX and cleared kernel handle inheritance on Windows, while preserving CRT descriptor modes.pipe2(O_CLOEXEC)on Android. Keep the checkedpipe/fcntlfallback on Apple, which has nopipe2._get_osfhandlereturning-2).Process-creation limitation
Apple's
pipe/fcntlfallback and Windows' CRT duplication followed by inheritance-flag restoration are not atomic with concurrent child-process creation. The API now explicitly requires applications to serialize child creation withStart()/Stop()to avoid those windows. The Windows implementation deliberately retains_dup/_dup2to preserve CRT text/binary/Unicode and other descriptor state rather than rebuilding descriptors with incomplete state.