From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 18AFA3858D35 for ; Thu, 22 Jun 2023 11:29:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 18AFA3858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35MBH9kk021344; Thu, 22 Jun 2023 11:29:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=ut/dwy2IuKpyW+BZQSEgmdc85rDiPsbFyebp3+IZ078=; b=YTsnl2eIDe5yXm+25DeOTRw9+mBgzIlvSwY21Y7eADUwzGUS/JVBXT5qIYUzETfUacD/ gTL+QKr7EUjdYtBuFOQptAHEQ8P7fl2IwmEHssgeNDreFWtklvYjkRG6CPqBtj49oJXv 8Hidrgk5t1+f6KKFLmqQiZdDKGZ0SnoLogSCuLm+vYp7hEb/HrtNtu88vCXPQ1pLToH0 g8z3Kf0sfz7oJBF3EytB17NYxJjU7k7Inr6Ddbzr1ToITmSrOJlFVftcd4IovPZMpfiV ALH1XHIcTw35qewGxMyqZZgRAotKNByCJgP0MOEPaN/gFtXVDMD98KgEWze1KFg9Gumm lA== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rcn9tg7cg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jun 2023 11:28:59 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35M3PbZd023319; Thu, 22 Jun 2023 11:28:58 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3r94f53e83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jun 2023 11:28:57 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35MBSt3128443324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jun 2023 11:28:55 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8036120043; Thu, 22 Jun 2023 11:28:55 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 587F720040; Thu, 22 Jun 2023 11:28:55 +0000 (GMT) Received: from [9.155.209.184] (unknown [9.155.209.184]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 22 Jun 2023 11:28:55 +0000 (GMT) Message-ID: <0708e0d49684be2c72ab81d36200892125b99d6e.camel@linux.ibm.com> Subject: Re: [PATCH 11/11] Process exit status is leader exit status testcase From: Ilya Leoshkevich To: Pedro Alves , gdb-patches@sourceware.org Date: Thu, 22 Jun 2023 13:28:55 +0200 In-Reply-To: <20220303144020.3601082-12-pedro@palves.net> References: <20220303144020.3601082-1-pedro@palves.net> <20220303144020.3601082-12-pedro@palves.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Gih9b2m37LDW5Nrh7krxXQjBYuJAWCeq X-Proofpoint-GUID: Gih9b2m37LDW5Nrh7krxXQjBYuJAWCeq Content-Transfer-Encoding: quoted-printable X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-22_07,2023-06-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxlogscore=982 clxscore=1011 malwarescore=0 bulkscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306220091 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2022-03-03 at 14:40 +0000, Pedro Alves wrote: > From: Lancelot SIX >=20 > This adds a multi-threaded testcase that has all threads in the > process exit with a different exit code, and ensures that GDB reports > the thread group leader's exit status as the whole-process exit > status.=C2=A0 Before this set of patches, this would randomly report the > exit code of some other thread, and thus fail. >=20 > Tested on Linux-x86_64, native and gdbserver. >=20 > Co-Authored-By: Pedro Alves > Change-Id: I30cba2ff4576fb01b5169cc72667f3268d919557 > --- > =C2=A0...rocess-exit-status-is-leader-exit-status.c | 64 > +++++++++++++++++++ > =C2=A0...cess-exit-status-is-leader-exit-status.exp | 45 +++++++++++++ > =C2=A02 files changed, 109 insertions(+) > =C2=A0create mode 100644 gdb/testsuite/gdb.threads/process-exit-status-is- > leader-exit-status.c > =C2=A0create mode 100644 gdb/testsuite/gdb.threads/process-exit-status-is- > leader-exit-status.exp This test fails on kernels >=3D 6.1. The symptom is that the kernel reports that all threads exit with the same status - that of the first thread to exit. Bisect points to: commit d80f7d7b2c75c5954d335dffbccca62a5002c3e0 Author: Eric W. Biederman Date: Tue Jun 21 14:38:52 2022 -0500 signal: Guarantee that SIGNAL_GROUP_EXIT is set on process exit Track how many threads have not started exiting and when the last thread starts exiting set SIGNAL_GROUP_EXIT. This guarantees that SIGNAL_GROUP_EXIT will get set when a process exits. In practice this achieves nothing as glibc's implementation of _exit calls sys_group_exit then sys_exit. While glibc's implemenation of pthread_exit calls exit (which cleansup and calls _exit) if it is the last thread and sys_exit if it is the last thread. This means the only way the kernel might observe a process that does not set call exit_group is if the language runtime does not use glibc. With more cleanups I hope to move the decrement of quick_threads earlier. Link: https://lkml.kernel.org/r/87bkukd4tc.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" I'm not sure what to do with it - can one claim that this is a kernel regression? Or should GDB be able to deal with that?