From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 495E41F5AE for ; Tue, 27 Apr 2021 21:46:53 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66D8A385482D; Tue, 27 Apr 2021 21:46:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66D8A385482D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619560012; bh=WQ7qszoWyhQARQ51fNuUm4CG2hYt5xu+tS8uJW+S8u4=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=P/hNRAgzq4i4rZVnDhOfYBNpF5iUzKNBh9T1LTnHz0hjSxN/0FDSQiD0h/apMh8tg lNw14DjYOvFV8/EjwjDtshQTOn/l2vj9E8qLG/TNPnCvVdGRe1vHrhtawEzirAmhHw p7z1OGzeShpyxpQbniGB74ExfVibWeN2fVeVHkw8= Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by sourceware.org (Postfix) with ESMTPS id 0F3E63857022 for ; Tue, 27 Apr 2021 21:46:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0F3E63857022 Received: by mail-qv1-xf35.google.com with SMTP id 3so5024398qvp.6 for ; Tue, 27 Apr 2021 14:46:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=WQ7qszoWyhQARQ51fNuUm4CG2hYt5xu+tS8uJW+S8u4=; b=pjpuhfWUbDDMESm+kzr2hCVTG9Jdg+9885Aaf49j5TuVDd7v7S/Vvhus+Zxx+2ZgY6 vOKEiVWyLPY5m3eqxU4jPdkNr5mlss6UklqJD1gfO+Fktor6PqWwTypkCXWvssZiC7oG KOYHNfCkLo1FFHy4S5IesmkwjfiVB0TcOu8a262AgyPUmPMNs/wZ0HpSd3NqFIfKLQ4+ KlIKEJrhw5V/IV0EbEUsrHGHnMmN/TIiSs5bLWlf9aJjQR0vTgRY52FkvhYV2idkFbvw G0m/FgaPr4ITaZknw3Gut9INptn/4l+TehPnyhBKgAfIfjBEHNVl5wqiWBbAi99Mx/za 7nWg== X-Gm-Message-State: AOAM53264gDGSn21NlDFcCopK/AyHaQMLUP1gIdYRctm3HKJ80glcGRJ q+BaqSmqFlFikztT1qofLfBxWHutfOU= X-Google-Smtp-Source: ABdhPJwhyuvOaUdnMs9rBkdaY3glxqMwaLMO1/DC9nPAoCnKYYL/1qdccQbmXiXioYjJsOMUaTd97w== X-Received: by 2002:a0c:b294:: with SMTP id r20mr25403769qve.16.1619560008327; Tue, 27 Apr 2021 14:46:48 -0700 (PDT) Received: from [192.168.0.41] (71-218-14-121.hlrn.qwest.net. [71.218.14.121]) by smtp.gmail.com with ESMTPSA id o189sm3640254qkd.60.2021.04.27.14.46.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Apr 2021 14:46:47 -0700 (PDT) Subject: Re: [PATCH] add attribute none to pthread_setspecific (BZ #27714) To: Joseph Myers References: <2ec7fadb-cc15-a005-f708-d2adecc8cc39@gmail.com> <875z08qqy8.fsf@oldenburg.str.redhat.com> Message-ID: <571eb466-8979-8579-3b52-38f29a628a39@gmail.com> Date: Tue, 27 Apr 2021 15:46:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Martin Sebor via Libc-alpha Reply-To: Martin Sebor Cc: Florian Weimer , Martin Sebor via Libc-alpha Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On 4/27/21 3:07 PM, Joseph Myers wrote: > On Tue, 27 Apr 2021, Martin Sebor via Libc-alpha wrote: > >> You're right. I had inadvertently reverted the pthread.h changes so >> my testing didn't expose it. Too many patches in the same tree... >> I've committed a1561c3bbe with the missing definition (and retesting >> the macro). > > How was that commit tested? It breaks the glibc testsuite build for me > with GCC 11 (on x86_64, also seen on lots of other architectures with > build-many-glibcs.py). These are warnings in my build (I've seen a few others scroll by and have always assumed they were expected(*)). Those you pasted below are intended: the none mode implies that const void* pointer should point to an object 1 byte in size (that excludes valid, past-the-end pointers, something I've been meaning to add an extension for). The test should change to use a valid pointer. I test by simply running make check. I can make the change to the test if you expect warning-free test builds. Martin [*] Here's an example of a warning I just noticed while rerunning make check: tst-chk1.c: In function ‘do_test’: ../bits/select.h:37:51: warning: value computed is not used [-Wunused-value] 37 | ((__FDS_BITS (s)[__FD_ELT (d)] & __FD_MASK (d)) != 0) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ ../misc/sys/select.h:87:33: note: in expansion of macro ‘__FD_ISSET’ 87 | #define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp) | ^~~~~~~~~~ tst-chk1.c:1681:3: note: in expansion of macro ‘FD_ISSET’ 1681 | FD_ISSET (FD_SETSIZE - 1, &s); | ^~~~~~~~ > > tst-tsd3.c: In function 'tf': > tst-tsd3.c:71:7: error: 'pthread_setspecific' expecting 1 byte in a region of size 0 [-Werror=stringop-overread] > 71 | if (pthread_setspecific (key1, (void *) 1l) != 0 > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from ../include/pthread.h:1, > from tst-tsd3.c:20: > ../sysdeps/nptl/pthread.h:1184:12: note: in a call to function 'pthread_setspecific' declared with attribute 'access (none, 2)' > 1184 | extern int pthread_setspecific (pthread_key_t __key, > | ^~~~~~~~~~~~~~~~~~~ > tst-tsd3.c:72:10: error: 'pthread_setspecific' expecting 1 byte in a region of size 0 [-Werror=stringop-overread] > 72 | || pthread_setspecific (key2, (void *) 1l) != 0) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from ../include/pthread.h:1, > from tst-tsd3.c:20: > ../sysdeps/nptl/pthread.h:1184:12: note: in a call to function 'pthread_setspecific' declared with attribute 'access (none, 2)' > 1184 | extern int pthread_setspecific (pthread_key_t __key, > | ^~~~~~~~~~~~~~~~~~~ > tst-tsd3.c: In function 'destr2': > tst-tsd3.c:56:11: error: 'pthread_setspecific' expecting 1 byte in a region of size 0 [-Werror=stringop-overread] > 56 | if (pthread_setspecific (key1, (void *) 1l) != 0) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from ../include/pthread.h:1, > from tst-tsd3.c:20: > ../sysdeps/nptl/pthread.h:1184:12: note: in a call to function 'pthread_setspecific' declared with attribute 'access (none, 2)' > 1184 | extern int pthread_setspecific (pthread_key_t __key, > | ^~~~~~~~~~~~~~~~~~~ > tst-tsd3.c: In function 'destr1': > tst-tsd3.c:40:11: error: 'pthread_setspecific' expecting 1 byte in a region of size 0 [-Werror=stringop-overread] > 40 | if (pthread_setspecific (key2, (void *) 1l) != 0) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from ../include/pthread.h:1, > from tst-tsd3.c:20: > ../sysdeps/nptl/pthread.h:1184:12: note: in a call to function 'pthread_setspecific' declared with attribute 'access (none, 2)' > 1184 | extern int pthread_setspecific (pthread_key_t __key, > | ^~~~~~~~~~~~~~~~~~~ > > (I also see similar errors building tst-tsd4.c. The testsuite builds > cleanly with the same compiler and the previous glibc commit.) >