From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67242 invoked by alias); 24 Mar 2017 12:39:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 67225 invoked by uid 89); 24 Mar 2017 12:39:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:209.85.216.196, H*RU:209.85.216.196, Hx-languages-length:1727, mac X-HELO: mail-qt0-f196.google.com Received: from mail-qt0-f196.google.com (HELO mail-qt0-f196.google.com) (209.85.216.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Mar 2017 12:39:38 +0000 Received: by mail-qt0-f196.google.com with SMTP id x35so166311qtc.1 for ; Fri, 24 Mar 2017 05:39:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9Y+naqPGs3Ef7z0mJtbVs5zkAYixLH8xqEVUQR0wzVs=; b=hkNA8z9X0AYDOQXvOnTzlULWWCsUgjbCKEUREZAGaT2QSDw/GDnjbhQ9gzJWA5v5G+ 3owWLgEESLzRrklWHAWjNL9ldGPhwlqdff626/l+1WSfevBUi3DK17rn8xBrhBRMx+7l HZ7NDZs+rPtp0BEWRJ1O3rn1/fDbGX1m1rCvQdIKXgvFRp/XLKF23NmkFvfx1W3R8qSM fc9nbMg3xyDmHlXuvAAVVg8U48ZXJVAKKaholRhwDs0mFvb73vhcfy4RtuosGSC9HjT9 gSnWg6/HqX5VUsqzNrR5VoVuR/h5XFkdCAwm49k3aJMVB2BvW76LWqsloWHcwEyIiDKw Hxng== X-Gm-Message-State: AFeK/H2owzYZmLw1BIcoYKyXcHdXUuzLlydcA6Y3jAUQhST5hKMKabNo4D/0pQHxjGhjxp8+V3J5K2lri/WT8g== X-Received: by 10.237.47.71 with SMTP id l65mr1537711qtd.177.1490359177479; Fri, 24 Mar 2017 05:39:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.39.162 with HTTP; Fri, 24 Mar 2017 05:39:17 -0700 (PDT) In-Reply-To: References: <1490324519-11228-1-git-send-email-yszhou4tech@gmail.com> <2b0bab84-e36e-e109-5444-dc84369dddce@redhat.com> From: Yousong Zhou Date: Fri, 24 Mar 2017 12:39:00 -0000 Message-ID: Subject: Re: [PATCH] Fix invalid sigprocmask call To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2017-03/txt/msg00435.txt.bz2 yousong On 24 March 2017 at 20:23, Yousong Zhou wrote: > On 24 March 2017 at 18:47, Pedro Alves wrote: >> On 03/24/2017 03:01 AM, Yousong Zhou wrote: >>> The POSIX document says >>> >>> The pthread_sigmask() and sigprocmask() functions shall fail if: >>> >>> [EINVAL] >>> The value of the how argument is not equal to one of the defined values. >>> >>> and this is how musl-libc is currently doing. Fix the call to be safe >>> and correct >>> >>> [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html >>> >> >> I don't agree. It's a musl bug. Please fix it / file a musl bug. > > I already did that before sending to gdb-patches > > http://www.openwall.com/lists/musl/2017/03/24/1 > > I am aware of the fact that the current code works with glibc and mac > osx 10.11.6. The Linux kernel code at the moment also accepts the > call with how==0 > > But this is more about interpretation of POSIX document itself. And > it says, clearly without pre-condition words or ambiguity in the > ERRORS section of that page, to return EINVAL if how is not equal to > one of the defined values. > > I also tried to find some posix-compliant testsuite and to search the > github code for samples of pthread_sigmask call. The first I came > across was the following code snippet at link > https://github.com/juj/posixtestsuite/blob/master/conformance/interfaces/pthread_sigmask/8-1.c#L57 > > pthread_sigmask(SIG_BLOCK, NULL, &oactl); > > > Regards, > yousong The following test case will also say for itself. https://github.com/juj/posixtestsuite/blob/master/conformance/interfaces/pthread_sigmask/16-1.c Regards, yousong