public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/17427] New: RFE: Async-safe access to error strings
@ 2014-09-23 16:14 arequipeno at gmail dot com
  2014-10-10  9:58 ` [Bug libc/17427] " fweimer at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: arequipeno at gmail dot com @ 2014-09-23 16:14 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17427

            Bug ID: 17427
           Summary: RFE: Async-safe access to error strings
           Product: glibc
           Version: 2.18
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: arequipeno at gmail dot com
                CC: drepper.fsp at gmail dot com

Currently, the only async-safe method of accessing error message strings is
with sys_errlist and sys_nerr, which are deprecated.  If eliminating direct use
of these variables is truly desired, I suggest that an async-safe replacement
is
required.

Implementation-wise, I'm thinking of something roughly equivalent to:

    const char *strerror_as_np(int errnum)
    {
        if (errnum < 0 || errnum >= sys_nerr) {
            errno = EINVAL;      /* maybe? */
            return NULL;
        }

        return sys_errlist[errnum];
    }

I would, however, document the function as a "best effort," which may return
NULL even for a valid and common value of errnum.  This should provide plenty
of wiggle room for future changes/standardization.  (I can dream!)

For an (IMO) legitimate use of async-safe access to error message strings,
please see the "Pre-exec child process error reporting stuff" portion of
https://github.com/ipilcher/n5550/blob/master/freecusd/err.c.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/17427] RFE: Async-safe access to error strings
  2014-09-23 16:14 [Bug libc/17427] New: RFE: Async-safe access to error strings arequipeno at gmail dot com
@ 2014-10-10  9:58 ` fweimer at redhat dot com
  2020-12-21  2:45 ` jscott at posteo dot net
  2020-12-21 11:50 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-10-10  9:58 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17427

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/17427] RFE: Async-safe access to error strings
  2014-09-23 16:14 [Bug libc/17427] New: RFE: Async-safe access to error strings arequipeno at gmail dot com
  2014-10-10  9:58 ` [Bug libc/17427] " fweimer at redhat dot com
@ 2020-12-21  2:45 ` jscott at posteo dot net
  2020-12-21 11:50 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jscott at posteo dot net @ 2020-12-21  2:45 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17427

John Scott <jscott at posteo dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jscott at posteo dot net

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/17427] RFE: Async-safe access to error strings
  2014-09-23 16:14 [Bug libc/17427] New: RFE: Async-safe access to error strings arequipeno at gmail dot com
  2014-10-10  9:58 ` [Bug libc/17427] " fweimer at redhat dot com
  2020-12-21  2:45 ` jscott at posteo dot net
@ 2020-12-21 11:50 ` adhemerval.zanella at linaro dot org
  2 siblings, 0 replies; 4+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2020-12-21 11:50 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=17427

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
           Assignee|unassigned at sourceware dot org   |adhemerval.zanella at linaro dot o
                   |                            |rg
   Target Milestone|---                         |2.32
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg
             Status|NEW                         |RESOLVED

--- Comment #1 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
This is implemented by 325081b9eb2035f8f025255206889208f330b590 (string: Add
strerrorname_np and strerrordesc_np) which implements both strerrorname_np and
strerrordesc_np GNU extensions.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-21 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 16:14 [Bug libc/17427] New: RFE: Async-safe access to error strings arequipeno at gmail dot com
2014-10-10  9:58 ` [Bug libc/17427] " fweimer at redhat dot com
2020-12-21  2:45 ` jscott at posteo dot net
2020-12-21 11:50 ` adhemerval.zanella at linaro dot org

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 read-only IMAP folder(s) and NNTP newsgroup(s).