From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by sourceware.org (Postfix) with ESMTPS id BC92D3858C39 for ; Mon, 27 Dec 2021 23:14:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BC92D3858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-x733.google.com with SMTP id 69so15648863qkd.6 for ; Mon, 27 Dec 2021 15:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version; bh=W4alDrmAs6qJs54fyysaUGQnfm3D2QXN0zPJaHhvnbo=; b=DBeCg+TThjQxoPa+BaGAGM/OdIB/M++NqatL8OotnQXAGcgSulF/gkHm/8irmxPi0o e9eG5X2XP0j2A+CR/xM2XqyGHWK4o0T6hdqY5e1qe/XzYA0cekPS10PGdlrTgWIZD5zW MsvuhSg3pr7MDqA5rv0aSox1Y28qkQ6EAIz+PCbo1s/zIVkQs5RCqcRHlzcHYRdix2YO 6p9cK8EEzS6q5Kjmn/yUrDrjtPhmNy7v4aP05PC7S7MnEyADo8ZAc6MGxj6UCE9DenRU VKH85mPdec09AGVY+5EpqfVVxKZCuqlwPJEiDzL4KafnE/GZZjKNUcsjlUIaL41E34Zp z9vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:date:message-id :mime-version; bh=W4alDrmAs6qJs54fyysaUGQnfm3D2QXN0zPJaHhvnbo=; b=4QeCY8mC7BNfR1yUlUr7lpqU4PITUSbI09s5rICsOeBlVXW473uSNZUucMhgULZZNd RzEZOv5rdHcknxF6XlMvXFT45LEsTIYewadwtRSboNiwSzUfZneT0IxeghnYW91HRldL tcOXE/rVHxJ9JFbrJxH44B3zc8tEEasdNx1Trucr2TN2VEmY2fMK3xeH3v0StsqXZxAj eqjIsGyoqSLEDh1J3GHhJwO0GrWEAxEiG4lZ1ckiJPjDGo84KwJ3RL/5kfqsNRRQ+9ZP AiVOZFVu9uRQ6AogmbuLUIRFwP39r6wTVrCrz1KXBCGriWVfbm7gvBdH3/ljdJiwN01O EE1w== X-Gm-Message-State: AOAM533cPr64d5jODY+/3EhWPHv/1BeC4dJ58DY6o7PvGxsbXs8jT0bB wlElWYHAlaSaq2xteGBSOeqCIW/Uhbw= X-Google-Smtp-Source: ABdhPJz+ciZuDFZpKp/15+jiuUa847RvuciTx8AE41eS5+514a4H4+RQsAV6QTuNIu+MumDqfmSmag== X-Received: by 2002:a37:a297:: with SMTP id l145mr13656621qke.472.1640646892077; Mon, 27 Dec 2021 15:14:52 -0800 (PST) Received: from davidm-laptop (hlfxns018gw-134-41-172-106.dhcp-dynamic.fibreop.ns.bellaliant.net. [134.41.172.106]) by smtp.gmail.com with ESMTPSA id q27sm9230983qki.100.2021.12.27.15.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Dec 2021 15:14:51 -0800 (PST) From: David McFarland To: marco.atzeri@gmail.com Cc: cygwin-developers@cygwin.com Subject: Re: Re: Signal delivered while blocked In-Reply-To: <2e5e006e-256d-17af-fbd5-2f38fce19b7c@gmail.com> Date: Mon, 27 Dec 2021 19:14:49 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2021 23:14:54 -0000 > Hi Guys, > > Some time ago (2017) a Postgres developer reported a signal issue > not present in older version (2013) > > https://sourceware.org/pipermail/cygwin/2017-August/234001.html > > For what I can see the issue is still present. > > > Ideas for debugging ? I had a look at your program. What seems to be happening is that he signal thread receives the signal, and uses find_tls to find a thread to handle it. If this is after a call to sigpermit(), then the mask will be zero and it will commit to sending the signal to the main thread of the test program. This is done without any lock, so the main thread can now handle an existing signal, call sigforbid() then usleep(). At this point the signal thread can resume, queuing up the next signal, and the main thread will pick it up when usleep calls sig_dispatch_pending, even though the main thread signal mask now disallows it. The old thread ended with a discussion about whether this is even valid se of sigprocmask(), which didn't seem to be resolved. Anyone have any thoughts on that?