This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Adding reentrancy information to safety notes?
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Rich Felker <dalias at libc dot org>, Michael Kerrisk <mtk dot manpages at gmail dot com>, Peng Haitao <penght at cn dot fujitsu dot com>, "linux-man at vger dot kernel dot org" <linux-man at vger dot kernel dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 05 Jan 2015 09:25:07 -0500
- Subject: Re: Adding reentrancy information to safety notes?
- Authentication-results: sourceware.org; auth=none
- References: <54A2C8A6 dot 9050100 at redhat dot com> <ork318eoj4 dot fsf at livre dot home> <20141230230529 dot GT4574 at brightrain dot aerifal dot cx> <orfvbwegqg dot fsf at livre dot home> <54A377B8 dot 60802 at redhat dot com> <ortx0cdv3c dot fsf at livre dot home> <54A41595 dot 4010007 at redhat dot com> <ord26zdlqt dot fsf at livre dot home>
On 01/01/2015 02:05 AM, Alexandre Oliva wrote:
> On Dec 31, 2014, "Carlos O'Donell" <carlos@redhat.com> wrote:
>
>> I did not know malloc was required to be AS-safe for POSIX compliance.
>
> Ugh. Sorry, my bad, it's not. malloc's AS-safety goal seems to have
> jumped from "desirable" to "mandatory" in my mind :-(
No worries. That's why we work together.
>> See: http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
>> 2.4.3 Signal Actions.
>
>> The list of functions does not list malloc.
>
> Beware, that's a very old version of POSIX that you referenced above.
> What led me to realize it was the use of the term "reentrant" there ;-)
You are correct, issue 6 is old, issue 7 is the most recent, with text here:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03
> Anyway, the corresponding table in current POSIX fails to list malloc as
> AS-Safe just the same ;-)
So to recap:
We would complicate a user malloc implementation by forcing them to use only
AS-safe functions.
We want to expand the list of usable functions the user can call from their
malloc without requiring it be all functions.
The tentative initial list is "all AS-Safe and SR-safe function." Where SR-safe
stands for synchronously reentrant e.g. can be reentered by the same thread, but
not from asynchronous contexts.
Cheers,
Carlos.