New issue
Advanced search Search tips

Issue 896336 link

Starred by 3 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Log stderr for crosvm

Project Member Reported by davidri...@chromium.org, Oct 17

Issue description

Currently stdout is logged via logger for crosvm, but stderr is not.  stderr is used for virglrenderer/virtio-gpu errors, and could potentially be used elsewhere.

One possible easily solution would be to dup2(STDOUT_FILENO, STDERR_FILENO) when logger is being started.  Alternatively, a second logger instance could be created if that doesn't work.
 
dup the fds.  splitting the streams always leads to weirdness and pain.

would be even better if crosvm itself did logging and didn't rely on output being slurped up by someone else.
re #1: crosvm uses syslog and so doesn't rely on slurping by anybody else. A library loaded, virglrenderer in this case, uses fprintf(stderr, ...) all over the place. That's harder to fix because its part of an upstream package.
assuming crosvm (or its children) are the ones using virglrenderer, seems like something crosvm should be handling rather than vm_tools.  it can create a pipe to bind its stdout/stderr for its random libs that have poor logging semantics, and then add that fd to whatever event loop you have to convert it to syslog calls.

then there's no need for `logger`.
crosvm currently has stdout going to syslog via the logger process?  Or are there some other paths where it directly logs as well?
yes, we're using `logger` currently.  a dup of stderr to stdout would keep the status quo while also including stderr.

my suggestion was for beyond that and stop using `logger` entirely.
Labels: -Pri-3 M-72 Pri-2
Owner: smbar...@chromium.org
Status: Assigned (was: Untriaged)
to be clear, i don't think it's a problem to approach this incrementally -- we're already spinning up logger and sending it output, so doing the stderr duping shouldn't be too hard.  we can then keep debating how to get rid of `logger`.

Sign in to add a comment