From patchwork Thu Aug 15 21:18:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 171450 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp16539ily; Thu, 15 Aug 2019 14:19:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7wmFWhRzWXAlRQsnMdeT8GmRmZiHLNLA/hgBK8a6ZXobbGjNtcTxJPttIDLF6Nyo34J5J X-Received: by 2002:a62:64d4:: with SMTP id y203mr7327991pfb.91.1565903949627; Thu, 15 Aug 2019 14:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565903949; cv=none; d=google.com; s=arc-20160816; b=VrMxQE+hTdEpsZ9Ag+0akY+ME713MibJxLlXhTPfELoWtbogYi4q1gYdSayXQOX9UB ffF8B27HK1K9TxRvTg7kBUA9YCBUqCvZqLoFVLSibeYMhBKmj9zpEVHgngQg0zFdPw/i QorNRFZEYruhAfjYlEbpazhCtuySM51PpoGTy+YtwWpVy5nXwvD7wMQ61G5wCijwDt/C auYCtnWtULgahFMDHRI13q9cxALbuiT3uHiScHp8junWcCiI0sqKEVXBYk1QuBsjibuK iIIgVLpdsKxlYOt4XlHPqmWmnTfhGVEbNUBpG2gqsXrci32yyDtafE0XQ1GXPTsRnt1L jLEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to:sender:list-help:list-post:list-archive :list-subscribe:list-unsubscribe:list-id:precedence:mailing-list :dkim-signature:domainkey-signature; bh=USb0e92xrMdwjFjt4UMhe9YbsXTiBYfRmilHa6bkkiM=; b=DkR9uiOwpgT2o+Bhtc5bibJK2H3b1u8XzDWMjXIc6dNe4wnRi/H11ChJtmaBeHKNkZ VvkccI5LgngsN3UPXme4Prdw1gaoX28yWfvDXMcrgiqvdr7xWOGWyOg0uGsvgnCrIpQT guK1Oy8OV6k/RQDdAbTPOOB8oR636BONYxTHn8tj7OwNGAw6tpMGpDmxj57dcT4D4FzJ xm6KgM4vzqabC3KO9t3pOxyxtL1whl6EfNEvIEDrnlPl6dJHYD5v+hRwxggWEuAOEo1c V8ald0dL91q6FNF6EJKFoPddbfZyCWnMxAfKX9QPoOAntedJRvr/tktUVD81G/hCZDJO 5hIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=DmVMlJcz; dkim=pass header.i=@linaro.org header.s=google header.b=JmPdFYcc; spf=pass (google.com: domain of libc-alpha-return-104502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-104502-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k73si2425070pge.353.2019.08.15.14.19.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Aug 2019 14:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-104502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=DmVMlJcz; dkim=pass header.i=@linaro.org header.s=google header.b=JmPdFYcc; spf=pass (google.com: domain of libc-alpha-return-104502-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="libc-alpha-return-104502-patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=V6yJUKC9Vxgfr7/rA2uVnjn3qjo8F8k 9N1QvS3swbLbeuoJZNuAwxmyPFGDb4oL51OCTBsULR1m7UHVYR1YhhANTNkDVKtf aXKHjpo3LJa0Pe97g4YoSbBYQxS6Fd72XLau0JVzzc69YMhUkNRmnVJ5qIkU+mvx TZOYlKLAW+UI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=8wqizd9stadwfeMIy8HoBA8hG7U=; b=DmVMl JczABYtvngvoYZTN0Ao7wtAL+pIsyj75Ml0o0/ZyORg/ovviU78i6LY7U5rZp+r/ GOMRwbaACwZZEgAiBM7OcRZ2llmTXll6na5vzteNMV7krj6wXgxQNM18dRJlXo/a dEG7QRRQPgXgv8eP2rCtfxPuGqANY8etHOztOY= Received: (qmail 51822 invoked by alias); 15 Aug 2019 21:18:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 51747 invoked by uid 89); 15 Aug 2019 21:18:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*RU:209.85.160.195, HX-Spam-Relays-External:209.85.160.195, HX-Languages-Length:947 X-HELO: mail-qt1-f195.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=USb0e92xrMdwjFjt4UMhe9YbsXTiBYfRmilHa6bkkiM=; b=JmPdFYcc+ARTx07ZcddU7huY21vzaI5reyJbNVNB8ZlpkgepVYE/VY0m4OAmjNcDeC 5Vhij1X2i9BkaSXZnBzpSWCTIhxib/sgtx/XBOPlmJhckKM5tJgJay05VaL6TBuPP7iy Sw1eL7y2T8vdY+AeYqJ3ZzEdOf4HG/dUJZlBDkeMhHvFNWdRSo8oZ+E+ySZfC8kUvv6+ RJigGy+Gfec2hzX4NDiAo9uVB5GnkQi8DxK/GRNZ2+IC0sXIW2r4WNSGUZZOEqr+LuLv D6q9WbpVxfRXiW6STQkc2IPpjSVgGAPpvynNK3SSOXjxaH52Z1GxWy9z7DNGckNlKbGZ LB4g== Return-Path: From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] nptl: Handle EPIPE on tst-cancel2 Date: Thu, 15 Aug 2019 18:18:41 -0300 Message-Id: <20190815211843.22799-2-adhemerval.zanella@linaro.org> In-Reply-To: <20190815211843.22799-1-adhemerval.zanella@linaro.org> References: <20190815211843.22799-1-adhemerval.zanella@linaro.org> The SIGPIPE can be handled before SIGCANCEL, which makes write fail and the thread return a non expected result. Checked on x86_64-linux-gnu. * nptl/tst-cancel2.c (tf): Do not abort with EPIPE. --- nptl/tst-cancel2.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/nptl/tst-cancel2.c b/nptl/tst-cancel2.c index 1f0429d343..632ea4e0ae 100644 --- a/nptl/tst-cancel2.c +++ b/nptl/tst-cancel2.c @@ -20,6 +20,7 @@ #include #include #include +#include static int fd[2]; @@ -32,7 +33,14 @@ tf (void *arg) write blocks. */ char buf[100000]; - while (write (fd[1], buf, sizeof (buf)) > 0); + while (1) + { + /* Ignore EPIPE errors for case the SIGPIPE is handle before + SIGCANCEL. */ + ssize_t ret = write (fd[1], buf, sizeof (buf)); + if (ret == 0 || (ret == -1 && errno != EPIPE)) + break; + } return (void *) 42l; }