libc: forward guest diagnostics when normal logging is silent #1569
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1569
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1569"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Buraddomoon on GitHub · 2026-10-16 20:37 UTC · original
Buraddomoon:fix/1540-guest-stdout→main· +229 −6 · 5 files · 3 commits · openMafia: The Old Country, Hellblade: Senua's Sacrifice, and Astro Bot are reported in #1540 to hide their own failure messages when normal logging is silent. This addresses the diagnostic-output request in section 5 of that issue.
Set
KYTY_GUEST_STDOUT=1before launch to additionally forward guestprintf/vprintfoutput to stderr with aGUEST_STDOUT:prefix and an immediate flush. Forwarding is opt-in and read on the first guest print call.snprintfcontinues to write only to its destination buffer.Validation
launcher, includingkyty_emulator, passed with Clang 19.1.7.guest_printfCTest cases passed in the build container and directly on Fedora: variable unset,0,1, and a non-enabling value.snprintfbehavior.AI assistance and human review
AI assistance was used for investigation, implementation, regression tests, automated validation, and drafting this description. The contributor reviewed the submitted diff and authorized submission. The automated checks above were run by the assistant. No games, controllers, or GPU were used for these tests, and no in-game improvement is claimed.
@coderabbitai[bot] on GitHub · 2026-10-16 20:41 UTC · original · edited 2026-10-16 20:56 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
4d92c6bf-d2ad-4be4-b491-289155f2f5a1📥 Commits
Reviewing files that changed from the base of the PR and between
7e76d107e6andc8537f3326.📒 Files selected for processing: 2
src/libs/guestPrintf.cpptests/GuestPrintfTests.cpp🚧 Files skipped from review as they are similar to previous changes: 1
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
📝 Walkthrough
When
KYTY_GUEST_STDOUTis exactly1, guestprintfandvprintfoutput is also written to stderr with aGUEST_STDOUT:prefix and flushed. The change adds tests for enabled and disabled forwarding, long output, embedded null bytes, andsnprintf. CMake and CI build and run the tests on Windows, macOS, and Linux. The README documents the setting and its behavior.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Feature
Merge Risk: ⚪ Minimal · up to
c8537The opt-in diagnostic forwarding matches its documentation, and enabled and disabled tests are configured across Windows, macOS, and Linux. No actionable merge-blocking issue is evident.
Pre-merge checks:
4 ·
1
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-10-16 20:41 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
0f09baab-3db0-4d17-8740-8ced16efbc05📥 Commits
Reviewing files that changed from the base of the PR and between
5dec523143and7e76d107e6.📒 Files selected for processing: 5
.github/workflows/build.ymlCMakeLists.txtREADME.mdsrc/libs/guestPrintf.cpptests/GuestPrintfTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-16 20:41 UTC · original · edited 2026-10-16 20:51 UTC
On
src/libs/guestPrintf.cppline 788 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Write all formatted bytes to stderr.
If a guest prints
a%cbwith a zero-valued%c,idxincludesa, the null byte, andb. The new%swrite stops at the null byte, so stderr losesb. Write the prefix separately, then write exactlyidxbytes frombuffer. Keep the flush. (pubs.opengroup.org)Proposed fix
📝 Committable suggestion
✅ Addressed in commit
c8537f3View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.