public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers
@ 2021-10-16  7:53 jan.kiszka at siemens dot com
  2021-10-16 20:51 ` [Bug nptl/28458] " vt at altlinux dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jan.kiszka at siemens dot com @ 2021-10-16  7:53 UTC (permalink / raw)
  To: glibc-bugs

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.

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

end of thread, other threads:[~2021-11-04  7:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-16  7:53 [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers jan.kiszka at siemens dot com
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

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).