From patchwork Fri Apr 3 20:31:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 38726 Return-Path: X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qt1-x843.google.com (mail-qt1-x843.google.com [IPv6:2607:f8b0:4864:20::843]) by sourceware.org (Postfix) with ESMTPS id 5BBBE385DC0A for ; Fri, 3 Apr 2020 20:32:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5BBBE385DC0A Received: by mail-qt1-x843.google.com with SMTP id c14so7695485qtp.0 for ; Fri, 03 Apr 2020 13:32:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=VxFNP5aIrgqebIXNb+21o2UufGAUIwpr79emCjUWqxI=; b=M4TM/R/KX1iSwqizcwtkViVNVeirYCXKZpEFhBYyVFOUNlXIn6p5JfwFHzseZrI/46 21uFQ8bc1FtThuc62CB8L4CSgi6FrD0CpWphYneLY04eNpch74G1lRKNdN3XTP40Rddg Ou7CixjA2uGpndm1Xz2TJEWeb7JjQrYHR8ZziuNnJihtdwt8Mb21WK8PzrrW9g5Qgt7/ R2UFB/Mg/eJHsXen22Y5qjhXS1ontRsUxVvUx7LUPbhYvsnqJBqxgTkDyAw31fyBpf96 K8Fk4i1aEdJopfIPWwSqD0B2464aYpWvWj3mKQWq+/vFudn0JE8MvsClsjkgVB5GaNVo 5gMA== X-Gm-Message-State: AGi0PuYrHxv2ApyqQLIoCdaLVP8J1Rv0HhXLmFQHNZl0xKSk/1kGapVS FRINo5m2WVXAeF7BE6GYVkBFAbFzeFA= X-Google-Smtp-Source: APiQypIf7D8IqTs8IPkiyzVnYq7q0t4vSwXEoYjgvNZyVMoD5vOUXbXYf1nmAQTNx09MCxVkYUHKjQ== X-Received: by 2002:aed:3383:: with SMTP id v3mr10410339qtd.177.1585945929548; Fri, 03 Apr 2020 13:32:09 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id d141sm7063535qke.68.2020.04.03.13.32.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 13:32:08 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v4 01/21] nptl: Do not close the pipe on tst-cancel{2,3} Date: Fri, 3 Apr 2020 17:31:41 -0300 Message-Id: <20200403203201.7494-2-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200403203201.7494-1-adhemerval.zanella@linaro.org> References: <20200403203201.7494-1-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-26.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 03 Apr 2020 20:32:11 -0000 This can cause a SIGPIPE before SIGCANCEL is processed, which makes write fail and the thread return an non expected result. Checked on x86_64-linux-gnu and powerpc64le-linux-gnu. --- nptl/tst-cancel2.c | 3 --- nptl/tst-cancel3.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/nptl/tst-cancel2.c b/nptl/tst-cancel2.c index 1e86711596..1732980b0f 100644 --- a/nptl/tst-cancel2.c +++ b/nptl/tst-cancel2.c @@ -73,9 +73,6 @@ do_test (void) return 1; } - /* This will cause the write in the child to return. */ - close (fd[0]); - if (pthread_join (th, &r) != 0) { puts ("join failed"); diff --git a/nptl/tst-cancel3.c b/nptl/tst-cancel3.c index 0a531dbcdb..3a0acac5e2 100644 --- a/nptl/tst-cancel3.c +++ b/nptl/tst-cancel3.c @@ -75,9 +75,6 @@ do_test (void) return 1; } - /* This will cause the read in the child to return. */ - close (fd[0]); - if (pthread_join (th, &r) != 0) { puts ("join failed");