Skip to content

aosp: Fix GTest output on AOSP. - #1

Closed
hferreiro wants to merge 1 commit into
aosp-posix_emu-assetsfrom
aosp-sblog
Closed

hferreiro wants to merge 1 commit into
aosp-posix_emu-assetsfrom
aosp-sblog

Conversation

@hferreiro

Copy link
Copy Markdown
Owner

musl flushes stdout/stderr via writev, so wrap it and route STDOUT_FILENO/STDERR_FILENO writes through SbLogRaw, which lands in Android logcat.

Bug: 495203133

musl flushes stdout/stderr via writev, so wrap it and route
STDOUT_FILENO/STDERR_FILENO writes through SbLogRaw, which lands in Android
logcat.

Bug: 495203133
@github-actions

Copy link
Copy Markdown

🤖 Gemini Suggested Commit Message


Error: Could not parse a valid response from the Gemini API. Please check the API response logs in the workflow run.

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@hferreiro hferreiro closed this Jun 22, 2026
@hferreiro
hferreiro deleted the aosp-sblog branch June 22, 2026 20:08

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c7405cf35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Route stdout/stderr writes, which musl flushes via writev, through SbLogRaw
// so they reach Android logcat.
ssize_t __wrap_writev(int fd, const struct iovec* iov, int iovcnt) {
if (fd == STDOUT_FILENO || fd == STDERR_FILENO) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve writes after stdout/stderr redirection

This check treats file descriptor numbers 1 and 2 as logcat forever, even after code redirects them with dup2/freopen. GoogleTest's capture support does exactly that by dup2(captured_fd, fd_) before reading the temp file back (third_party/googletest/src/googletest/src/gtest-port.cc:1150-1166), so any captured printf/fprintf flush that musl emits via writev will be reported as successfully written but sent to SbLogRaw instead of the capture file. That makes captured stdout/stderr and death-test stderr logs come back empty on the Android Starboard build this wrapper targets.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant