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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  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 ` vt at altlinux dot org
  2021-10-18 11:11 ` glebfm at altlinux dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vt at altlinux dot org @ 2021-10-16 20:51 UTC (permalink / raw)
  To: glibc-bugs

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

Vitaly Chikunov <vt at altlinux dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vt at altlinux dot org

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: glebfm at altlinux dot org @ 2021-10-18 11:11 UTC (permalink / raw)
  To: glibc-bugs

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

Gleb Fotengauer-Malinovskiy <glebfm at altlinux dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glebfm at altlinux dot org

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2021-10-18 13:35 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

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

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
I'm not aware of any reasonable way to suppress this GCC warning.

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  2021-10-16  7:53 [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers jan.kiszka at siemens dot com
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2021-10-18 13:36 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
Just to be clear, I agree that this warning is wrong because it also happens
for MAP_FAILED and other POSIX pointer constants.

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  2021-10-16  7:53 [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers jan.kiszka at siemens dot com
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jan.kiszka at siemens dot com @ 2021-10-18 13:46 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 from Jan Kiszka <jan.kiszka at siemens dot com> ---
Then, could someone familiar with the details (also) file a bug report with
them? Or did this happen already?

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  2021-10-16  7:53 [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers jan.kiszka at siemens dot com
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2021-10-18 13:50 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=102329
         Resolution|---                         |MOVED

--- Comment #4 from Florian Weimer <fweimer at redhat dot com> ---
I found an existing GCC bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102329

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  2021-10-16  7:53 [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers jan.kiszka at siemens dot com
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2021-11-04  7:00 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-11-04
     Ever confirmed|0                           |1
             Status|RESOLVED                    |REOPENED
         Resolution|MOVED                       |---

--- Comment #5 from Florian Weimer <fweimer at redhat dot com> ---
It's not just pseudo-pointers, we get a warning for this as well:

#include <pthread.h>

extern int x[1];

void
f (pthread_key_t key)
{
  pthread_setspecific (key, &x[1]);
}

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

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

* [Bug nptl/28458] pthread_setspecific rejects pseudo pointers
  2021-10-16  7:53 [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers jan.kiszka at siemens dot com
                   ` (6 preceding siblings ...)
  2021-11-04  7:00 ` fweimer at redhat dot com
@ 2021-11-04  7:00 ` fweimer at redhat dot com
  7 siblings, 0 replies; 9+ messages in thread
From: fweimer at redhat dot com @ 2021-11-04  7:00 UTC (permalink / raw)
  To: glibc-bugs

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

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |WAITING

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