mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: some fixes to musl
Date: Fri, 22 Jul 2011 09:30:21 -0400	[thread overview]
Message-ID: <20110722133021.GF132@brightrain.aerifal.cx> (raw)
In-Reply-To: <20110722081910.GA3593@albatros>

On Fri, Jul 22, 2011 at 12:19:10PM +0400, Vasiliy Kulikov wrote:
> On Thu, Jul 21, 2011 at 23:00 +0400, Solar Designer wrote:
> > Personally, I've been using different approaches to this in different
> > ones of my programs.  For musl, I think the "always check" approach may
> > be the better one.  Yes, the code size increase from those error
> > handling paths is unfortunate...  Some use of goto can make them smaller
> > and keep them out of the same cache lines with actually running code.
> 
> The problem here is that there might be no good way to handle errors
> of error handling code.  If we allocate resource A, then B, and B
> allocation fails, we should release A and return error code.  What to do
> if releasing A fails?  Return error code and leave A allocated
> (==leaked)?  Try to release it in a cycle (potential infinite loop)?
> Terminate the process (not expected by the caller)?
> 
> I don't have a good solution...

The good solution is to demand that kernel developers not create such
bugs and calling them out on it when they do...

Rich


  reply	other threads:[~2011-07-22 13:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21 17:02 Vasiliy Kulikov
2011-07-21 18:21 ` Rich Felker
2011-07-21 19:00   ` Solar Designer
2011-07-22  8:19     ` Vasiliy Kulikov
2011-07-22 13:30       ` Rich Felker [this message]
2011-07-21 19:17   ` Vasiliy Kulikov
2011-07-22  2:08     ` Rich Felker
2011-07-24  9:39       ` Vasiliy Kulikov
2011-07-24 12:56         ` Rich Felker
2011-07-24 18:38           ` Vasiliy Kulikov
2011-07-24  9:19   ` close(2) failure cases (was: some fixes to musl) Vasiliy Kulikov
2011-07-24 12:24     ` Rich Felker
2011-07-24 17:49       ` Vasiliy Kulikov
2011-07-24 22:29         ` Rich Felker
2011-07-25 17:36           ` Vasiliy Kulikov
2011-07-22  1:57 ` some fixes to musl Rich Felker
2011-07-22  4:30   ` Rich Felker
2011-07-22  8:26     ` Vasiliy Kulikov

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=20110722133021.GF132@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).