From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC27B385841A; Sat, 16 Oct 2021 07:53:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC27B385841A From: "jan.kiszka at siemens dot com" To: glibc-bugs@sourceware.org Subject: [Bug nptl/28458] New: pthread_setspecific rejects pseudo pointers Date: Sat, 16 Oct 2021 07:53:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: nptl X-Bugzilla-Version: 2.34 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jan.kiszka at siemens dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2021 07:53:38 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28458 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=3Dstringop-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 o= nly NULL or valid pointers must be passed to pthread_setspecific. --=20 You are receiving this mail because: You are on the CC list for the bug.=