All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: Abuse of warnings for unhandled errors and programming errors
Date: Mon, 15 Sep 2025 19:02:45 +0100	[thread overview]
Message-ID: <aMhUxTLiKorN5tjf@redhat.com> (raw)
In-Reply-To: <87frcupny3.fsf@pond.sub.org>

On Wed, Sep 10, 2025 at 01:05:40PM +0200, Markus Armbruster wrote:
> Daniel P. Berrangé <berrange@redhat.com> writes:
> > On Fri, Aug 08, 2025 at 11:30:32AM +0200, Markus Armbruster wrote:
> >
> > I don't see 'warnings' as something directly actionable for a user.
> > Rather they are messages that I would want to see included in a log
> > file that a user attaches to a bug report if they find some behavioural
> > problem. If the user understands the warning great, but that isn't a
> > requirement.
> >
> > IOW, while informative warnings is of course better than not, as long
> > as the warning message contains sufficient info for the maintainer to
> > understand what happened the minimum quality bar is satisfied IMHO.
> 
> That's a low quality bar indeed.  Here's mine:
> 
> 1. A warning should make perfectly clear whether this is a bug that
> should be reported, or an issue with usage, resources, etc. that can be
> ignored, but may help understand future trouble, if any (typically an
> ordinary error that wasn't fully handled).  Our errors make bug
> vs. ordinary error clear.
> 
> 2. A warning of the former kind (bug) should provide information
> developers need to start debugging.  For errors, we give them a core
> dump, source file and line number.  For warnings, we currently give them
> grep and warm wishes.

Don't understate the value of "grep"  :-)

It is my #1 tool when I see a string mentioned in bug report, whether
that's from error_report or warn_report.

What annoys/frustrates me is when the message (whether an eror or
warning) lacks the technical details of exactly what failed.

ie if the message doesn't substitute in either the errno value, or the
strerror string, or equivalent, then it massively reduces the chances
of diagnosis unless the bug is easily reproducible.

> 3. A warning of the latter kind (not a bug) should at least try to
> provide hints that help users diagnose and correct / work around what's
> wrong.  "warning: failed to WSAEventSelect()" doesn't.  "warning:
> trouble initializing slirp for user mode networking" might.

I agree that the latter is more informative for users, though for
developers it might be worse as such a generic message may provide
cover for several different low level problems. 

Neither help me diagnose the problem though if I see them in a bug
report though, because neither include the "WSAGetLastError()" value
(or its string equivalent).

Probably we deserve both. In the case of "Error" objects, we have
error_prepend so code can do

  error_setg(errp, "failed to WSAEventSelect: %s", WSAGetLastError())

and then the caller one or more levels up the stack can do

  error_prepend(errp, "unable to initialize slirp user mode networking")

which becomes useful when we see the final error_report() or equiv.

We don't have an error_prepend concept for warnings 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-09-15 18:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08  9:30 Abuse of warnings for unhandled errors and programming errors Markus Armbruster
2025-08-19 12:30 ` Daniel P. Berrangé
2025-09-10 11:05   ` Markus Armbruster
2025-09-15 18:02     ` Daniel P. Berrangé [this message]
2025-09-16 13:25       ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMhUxTLiKorN5tjf@redhat.com \
    --to=berrange@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.