Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 01:01:54 +0400
From:      Andrey Chernov <ache@FreeBSD.ORG>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Pawel Jakub Dawidek <pjd@FreeBSD.ORG>, freebsd-arch@FreeBSD.ORG
Subject:   Re: svn commit: r236582 - head/lib/libc/stdlib
Message-ID:  <20120605210154.GA22370@vniz.net>
In-Reply-To: <20120606054555.U1456@besplex.bde.org>
References:  <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> <20120605130922.GE13306@vniz.net> <20120606043731.D1124@besplex.bde.org> <20120605194102.GA21173@vniz.net> <20120606054555.U1456@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 06, 2012 at 06:11:01AM +1000, Bruce Evans wrote:
> This is essentially unusable (so a bad idea).  Instead of unconditionally
> saving and restoring errno around calls to free(), portable POSIX code
> can soon use a messy ifdef to avoid doing this in some cases, but still
> has to do it in other cases.  The results is just bloat and complexity
> at the source level:

It looks like they now consider POSIX as moving target where previous 
POSIX versions compatibility is not so essential to care about much. I 
don't have other interpretation of their decision to suddenly accept 
free() as not modifying errno. Since they clearly indicate code 
differences for old and new standard, they are well aware of them and of 
resulting code bloating.

> However, free() is currently not careful about errno.  It begins with
> an optional utrace() call, and this can in theory fail with errno ENOMEM
> even if there are no bugs in malloc() (all other errors from utrace()
> indicate bugs in the caller, assuming that the list of errnos in its man
> page is complete).  malloc.c makes a few other sys(lib?)calls and never
> saves errno.  I don't know if the others are reachable from free().

I fill PR about that:
http://www.freebsd.org/cgi/query-pr.cgi?pr=168719

-- 
http://ache.vniz.net/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120605210154.GA22370>