public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jan.kiszka at siemens dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers
Date: Sat, 16 Oct 2021 07:53:37 +0000	[thread overview]
Message-ID: <bug-28458-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 28458
           Summary: pthread_setspecific rejects pseudo pointers
           Product: glibc
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: jan.kiszka at siemens dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Since a1561c3bbe8e72c6e44280d1eb5e529d2da4ecd0, pthread_setspecific started to
reject pseudo pointers like (const void *)1L:

printf.c:732:9: error: 'pthread_setspecific' expecting 1 byte in a region of
size 0 [-Werror=stringop-overread]
  732 |         pthread_setspecific(cleanup_key, (const void *)1);

This breaks existing code that wants to signal special conditions to key
readers ("not an object") or want to use pthread_key_create to register a
per-thread destructor. These issues can be worked around, but users will be
confronted with valid but no longer compiling code first of all.

Reading the Open Group spec on this, I do not find any hint that suggests only
NULL or valid pointers must be passed to pthread_setspecific.

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

             reply	other threads:[~2021-10-16  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16  7:53 jan.kiszka at siemens dot com [this message]
2021-10-16 20:51 ` [Bug nptl/28458] " vt at altlinux dot org
2021-10-18 11:11 ` glebfm at altlinux dot org
2021-10-18 13:35 ` fweimer at redhat dot com
2021-10-18 13:36 ` fweimer at redhat dot com
2021-10-18 13:46 ` jan.kiszka at siemens dot com
2021-10-18 13:50 ` fweimer at redhat dot com
2021-11-04  7:00 ` fweimer at redhat dot com
2021-11-04  7:00 ` fweimer at redhat dot com

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=bug-28458-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /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.
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).