GNU bug report logs - #11058
Completion of error handling

Previous Next

Package: coreutils;

Reported by: Markus Elfring <Markus.Elfring <at> web.de>

Date: Wed, 21 Mar 2012 22:35:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #7 received at control <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: Markus Elfring <Markus.Elfring <at> web.de>
Cc: 11058-done <at> debbugs.gnu.org
Subject: Re: bug#11058: Completion of error handling
Date: Wed, 21 Mar 2012 16:13:34 -0600
[Message part 1 (text/plain, inline)]
tag 11058 notabug
thanks

On 03/21/2012 03:50 PM, Markus Elfring wrote:
> Hello!
> 
> I have looked at a few source files for your current software. I have
> noticed that some checks for return codes are missing.

Thanks for the report.

> 
> Would you like to add more error handling for return values from
> functions like the following?
> - atexit ⇒ main
> 
> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/date.c?id=3ba8b044267a5f7cfa8a7b0d7f19dab3f21431da#n320

Maybe worth cleaning up all atexit() calls, but unlikely to ever fail
since POSIX guarantees at least 32 successful atexit calls and we are
only making 1.  I'm not losing any sleep if we don't change this.

> 
> - fputs ⇒ print_numbers
> 
> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/seq.c?id=d3227eeb90c8308abd1e6bf08ee253b7a4e78d1d#n238
> 
> 
> - printf ⇒ write_header
> 
> http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/head.c?id=d7878454cd02518959b0d6036db3a5b6ff00ca57#n162

Intentional.  We have chosen to instead install an atexit handler as
well as use the gnulib module close-stream, which guarantees that we
investigate ferror() for all closed FILE*, and deal with the errors in a
central location rather than bloating the code to deal with errors after
every single operation on a FILE*.  Not worth your time to try to patch
these.

You can still submit patches, and we will still evaluate them on their
individual merits, but I don't see this as fixing any actual bugs at the
moment, so I'm marking this bug as closed.

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 13 years and 141 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.