From patchwork Thu Apr 2 17:09:50 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Moritz KLAMMLER (FERCHAU)" X-Patchwork-Id: 132633 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id AEE294BA23E9 for ; Thu, 2 Apr 2026 17:10:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEE294BA23E9 Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=ferchau.com header.i=@ferchau.com header.a=rsa-sha256 header.s=s2048 header.b=n2ztQBfW; dkim=pass (1024-bit key, unprotected) header.d=ablegroupde.onmicrosoft.com header.i=@ablegroupde.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ablegroupde-onmicrosoft-com header.b=ZiMedT2z X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mx1.ferchau.com (mail.ablegroup.de [212.211.178.98]) by sourceware.org (Postfix) with ESMTPS id 6295E4BA23D4 for ; Thu, 2 Apr 2026 17:09:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6295E4BA23D4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ferchau.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ferchau.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6295E4BA23D4 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=212.211.178.98 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775149796; cv=pass; b=vd5e1p2X0SKDRHHJPJ/BW5Z+594nK4CUfWxnBSV9+zkLCthqpiCQJbQX13m3sbqKlji3XGW83L5bDntzWdXDLNej6EavrK5QNz7PQdtWVIrMh4aUpZ0O8OZYEfup/QzDPsugLgDABa616hnXFpFdJ+/JHPKlVl0BqohvFVEJ+hI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1775149796; c=relaxed/simple; bh=OIAA+MFHNGt9WBY/dfPS8XwEMOZxlyD7YgChBUZ9wdU=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=RF34gVNNUE65NoCAkM39L0UjOgrfOsyHhRoU3bUoZm58y9Hjxohs+ufd6vZtCLW9E0TeZFut+DtgWtZwBUUSn8RiJZMMf3cVxRARbFAdRYHuOI0Ws5oxXVX/swZ3NOBHkGw5+RwFe3JiDzgNVPt2/JMVBasZvPTngdv1hI2vsmc= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6295E4BA23D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ferchau.com; i=@ferchau.com; q=dns/txt; s=s2048; t=1775149797; x=1806685797; h=arc-seal:arc-message-signature: arc-authentication-results:dkim-signature:from:to:subject: thread-topic:thread-index:date:message-id:references: in-reply-to:accept-language:content-language: x-ms-has-attach:x-ms-tnef-correlator:msip_labels: authentication-results:x-ms-publictraffictype: x-ms-traffictypediagnostic: x-ms-office365-filtering-correlation-id: x-ms-exchange-senderadcheck:x-ms-exchange-antispam-relay: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report: x-ms-exchange-antispam-messagedata-chunkcount: x-ms-exchange-antispam-messagedata-0:content-type: content-transfer-encoding:mime-version: x-exchange-routingpolicychecked: x-ms-exchange-crosstenant-authas: x-ms-exchange-crosstenant-authsource: x-ms-exchange-crosstenant-network-message-id: x-ms-exchange-crosstenant-originalarrivaltime: x-ms-exchange-crosstenant-fromentityheader: x-ms-exchange-crosstenant-id: x-ms-exchange-crosstenant-mailboxtype: x-ms-exchange-crosstenant-userprincipalname: x-ms-exchange-transport-crosstenantheadersstamped: x-cse-connectionguid:x-cse-msgguid:ironport-data: ironport-hdrordr:x-talos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kUbRj oMHFq8qNLLmYCfxxe500x5fhxAE01S/LLsF3tXuA5iCTKHTYo+ X-Talos-CUID: 9a23:+2JvGmgEPKTkthBZcNRKHcCNFjJuT3nk6lf9ZH6DVDg2ELyZGFqt+OR5qp87 X-Talos-MUID: 9a23:ff/Vxww3Z+SnKpspZi7d4qwuHdmaqLiHOWksnb8dgfjHKSV1Kh2Z3Cm2RYByfw== X-IronPort-AV: E=Sophos;i="6.23,156,1770591600"; d="scan'208";a="78130840" Received: from gmzrzex001.ferchau.local ([10.100.54.1]) by mx1.ferchau.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2026 19:09:55 +0200 Received: from GMZRZEX002.Ferchau.local (10.100.54.2) by GMZRZEX001.Ferchau.local (10.100.54.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.35; Thu, 2 Apr 2026 19:09:54 +0200 Received: from GV1PR07CU001.outbound.protection.outlook.com (40.93.214.103) by exchange.ferchau.com (172.16.19.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.35 via Frontend Transport; Thu, 2 Apr 2026 19:09:54 +0200 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w19Nc4JbKKfJ/jPL9XHE5SeaHvxKUlCbmdm/X54/WCt1w95ueYk9Du3y0IG5Lc9kpo6u/2+MkZNSNGZQYu7dLGwA+gmpRJKD0QG/3XIhPRuknooCofypgp/QBjLob781BfbpWA0un3D9f9Y1+RalhygILw8c3+pmucjeb6QCpxod7A5hB/KhtMAhQ3KTKSXkPjfijMkos1/f2cs82nOGZnBA7i7mh8N6PdWI+M1suViwsIFyNRDT1r4PJUjVBpc/lgNi0zXeGKMn/uwhQS3mhqgTvbnrnu7O46a/YJheq95A2c4cCJaiykyHtHYmZwXMqGrbfPIobdCappZ7ucxMLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OIAA+MFHNGt9WBY/dfPS8XwEMOZxlyD7YgChBUZ9wdU=; b=MaM8Os2UGH7vljW8mHAqQS9wDbCTX+9fZoWiMpKPLf4MjK3T//Ad46AQIn/Bco7VS2xlSihPiQABrYJr3g0xmgrXPiVbmLmR5QXgyRb8VqDlJsS/65NIvkKh7QdgxIPFn3Uu6Bi3U/opjAUMHznacjI8b7kPjLUUXz+8sK2KeGmrzxoM4mLUc7Onk7XqmrQv/jLd8LfZvzEjarXJAjif0gw44n4xDc/4ouo60y7dPV9huQ9j6YgTTCfeMmFPxIWJMzlve3ik2bvI6LqB3SEa2NyOnY4ac7MJoSjIys1Hqo9Vh8D5oCIgYfgqsupl9cVBUWnDaIaqgN4ZiMzmLUR11w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ferchau.com; dmarc=pass action=none header.from=ferchau.com; dkim=pass header.d=ferchau.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ablegroupde.onmicrosoft.com; s=selector1-ablegroupde-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OIAA+MFHNGt9WBY/dfPS8XwEMOZxlyD7YgChBUZ9wdU=; b=ZiMedT2zUcaUxruAdFjBKJXHmHSNlzQkYmK9SsR2R0iLafiqKBMJEPgjr+i/NtxCUwjA8RnW8cCfWDMgdaVasUpCK/x/M1du66jHkGWtSjFSCKJLuIlzERumep1ic802UQWaxfVuf5VFeOxq2eDBfGar5dtuRFHS/30t8KPG29Q= Received: from PR3PR06MB6889.eurprd06.prod.outlook.com (2603:10a6:102:87::9) by FRZPR06MB11242.eurprd06.prod.outlook.com (2603:10a6:d10:1c8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.16; Thu, 2 Apr 2026 17:09:51 +0000 Received: from PR3PR06MB6889.eurprd06.prod.outlook.com ([fe80::7396:2256:3ddb:4637]) by PR3PR06MB6889.eurprd06.prod.outlook.com ([fe80::7396:2256:3ddb:4637%3]) with mapi id 15.20.9769.016; Thu, 2 Apr 2026 17:09:50 +0000 From: "Moritz KLAMMLER (FERCHAU)" To: Adhemerval Zanella Netto , "libc-alpha@sourceware.org" Subject: [PATCH] nptl: futex_lock_pi deadlock detection provides valuable information but it is turned into a rather cryptic assertion failure Thread-Topic: [PATCH] nptl: futex_lock_pi deadlock detection provides valuable information but it is turned into a rather cryptic assertion failure Thread-Index: AQHcbnK4Dzm02VYQ8EyWQ8MgFDPAAbUl6RwAgKa+5hA= Date: Thu, 2 Apr 2026 17:09:50 +0000 Message-ID: References: <2bf1c649-8a6a-4f9e-9bc7-c01f2fce81c6@linaro.org> In-Reply-To: <2bf1c649-8a6a-4f9e-9bc7-c01f2fce81c6@linaro.org> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ferchau.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PR3PR06MB6889:EE_|FRZPR06MB11242:EE_ x-ms-office365-filtering-correlation-id: ec168149-0f0b-4a58-929e-08de90daa6d0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700021|13003099007|22082099003|18002099003|56012099003; x-microsoft-antispam-message-info: O69DOiMnJwghIuQEuzPbofaHq4OuVYST689ljApTF4R9Ze4ZwbvkT3fSxT4jyvrCmxz5xjvmGGizPlNuIdMgzBO5uhVdJkZMxWQawoCxIBs5pGeCjldtYjN4SJB0t6lxBbkeyjFKvD+EQNtZcdbFZPVENAhy19fG6cf6C1YYRT+y0xjoCwgTbw0j9/gnPqb5GKMSQ27PdbyJt7VpGlSIQQwF2T4ieQONRJrb6IoFaBdHMErT+7Qbm+ZTCazxNXjDFTBmHClnQ/8W6jEU3/cXtZBZCSGpZeGUPjyngZpscqixapUiUSkedEr6EoAxIy3WUx0b7V10/ncnIc83/H1kVRbjqZo8kHbdGJupvBOt/jvEdtmeXxg6CirR1PiC2vh5egKcnlKWas0i7/1ClbfMvw2jm7gDU+DRpszAh1HzV1UPH4wbCHPCUMC/8ebmEckyvHkLGB+2thQHBwKaYgohN3kyrOUlWtgWiUD8uG24qxK4U5DjjKlcGnniOEd4ixCYNq1iY1wQYYNGdddy/F7mvtBdpViyczWXADCZqCW0Q7VIq8arzykZ/WOJ2NOppw7QC4J5fQmwJOCCHurkFV3hCAd8P3YTf4R4RSH+lPzdGYSFuE9tbeiXKaSQDzxXjGlohM56Nj4M8z/lKq11vyrVKlDy1NCWA+Dsh8xBVpwK9tOql/Mr0ZIT3BfVOjjuFI/A3sI/tpj4p7nkZvfpDqBHPA+ldg/CajhxF4ORhlp1w77BWyMat7HNjhEiT1iPOBbZ x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR06MB6889.eurprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700021)(13003099007)(22082099003)(18002099003)(56012099003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?jHL0FXVzbqSquDTweqUSoyrpecE4?= =?utf-8?q?TCVk6GcjwSpNzuJcIzLf2xpk7/aJCq8wAWF6v/+i5kupoUgf+vBKnJRhI5KWFt12u?= =?utf-8?q?Dai+F+/f8Y8PqLuuO86m5+j9G82SXklosbtfbqaWSAaPncs8SXcK6KqniIoCnyw7t?= =?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7gFXWefjA4EBtS6JODRwPyKG1zhjkOeTKjx1tll0XKAoNhoAeIQNdjo7D44JJg1QjlEtAINNygw== X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PR3PR06MB6889.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec168149-0f0b-4a58-929e-08de90daa6d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Apr 2026 17:09:50.8707 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9a3c2f68-d5b5-4769-b2f8-8d6fe142b164 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Yab7JAePgcr2gn5LaoIA/OpzSd9IgzjGg9KplJ5k80CpJhNQiS+dKJw/hkKpOIBh+Ij8AGizjkUqW94cUPdOAMlwlqnOMCEP1KiTb/fw2kk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: FRZPR06MB11242 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org Hi Adhemerval, thanks for your assessment and please excuse the very long wait. Getting the copyright clearance from my employer to let me submit this patch took... a bit longer than expected. But we eventually did it. Attached is a conservative patch that will change pthread_mutex_lock only for recursive and error-checking PI mutexes to propagate the EDEADLK from the kernel to the user (these mutex types would previously have triggered the assertion). In my opinion, it would probably be more useful and easier to explain to propagate EDEADLK for all PI mutexes. But doing so gave me these two new test failures: nptl/tst-mutexpi6 nptl/tst-thread-affinity-sched Apparently, those are depending on the deadlock actually happening for normal mutexes. Please help me understand whether this is behavior that we'd like/have to preserve. I'll be happy to adjust the patch accordingly. The added test case currently only checks for EDEADLK to be returned, but doesn't cover the cases where we still expect the deadlock to happen. I could add these as well, but it would introduce an (unreasonably?) long delay, waiting for the alarm clock to go off eventually. Would you rather take this delay over the lack of test coverage? Please also let me know whether having one test executable that loops over the various types (current patch) or one executable per type would be preferred. I've tried my best to be consistent with the code formatting, using the .clang-format file as far as this was applicable, but the space & tabs mixture gave me some trouble. Many thanks and best regards, Moritz From 618d71460ca8f66cd521df7bccc2fd16f8899335 Mon Sep 17 00:00:00 2001 From: Moritz Klammler Date: Thu, 2 Apr 2026 18:10:01 +0200 Subject: [PATCH 1/1] nptl: Propagate EDEADLK from FUTEX_LOCK_PI for errror-checking and recursive mutexes This patch changes the behavior of pthread_mutex_lock for error-checking and recursive PI mutexes in case of non-trivial deadlock. The user-space code doesn't detect the case where two or more threads would mutually deadlock each other, but the Linux kernel can. NPTL's previous behavior, if the syscall returns EDEADLK, was to run into an assertion. With this patch, the error code will be propagated to the caller who might then, at its own discretion and with knowledge about the application-level logic, use it to attempt resolving the situation gracefully or terminate the process after all. The behavior for other (normal) mutex types is not changed, they will continue to actually deadlock the calling thread. Since POSIX doesn't seem to mandate any particular behavior for this situation, and no existing code should have a dependency of running into an assertion, changing this behavior to what is presumably the most useful one seems to be justified. The previous (design) discussion can be seen here: https://sourceware.org/pipermail/libc-alpha/2025-December/173431.html Signed-off-by: Moritz Klammler --- nptl/Makefile | 1 + nptl/pthread_mutex_lock.c | 15 +++- nptl/tst-deadlk-pi.c | 2 + nptl/tst-deadlk.c | 183 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 nptl/tst-deadlk-pi.c create mode 100644 nptl/tst-deadlk.c diff --git a/nptl/Makefile b/nptl/Makefile index 85f95dd0cf..41106677f7 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -283,6 +283,7 @@ tests = \ tst-cleanup5 \ tst-cond26 \ tst-context1 \ + tst-deadlk-pi \ tst-default-attr \ tst-dlsym1 \ tst-exec4 \ diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index a697f2b6ca..faf53d44fe 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -418,9 +418,18 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex) NULL, private); if (e == ESRCH || e == EDEADLK) { - assert (e != EDEADLK - || (kind != PTHREAD_MUTEX_ERRORCHECK_NP - && kind != PTHREAD_MUTEX_RECURSIVE_NP)); + if (e == EDEADLK + && (kind == PTHREAD_MUTEX_ERRORCHECK_NP + || kind == PTHREAD_MUTEX_RECURSIVE_NP)) + { + /* FUTEX_LOCK_PI may return EDEADLK due to cross‑thread + * deadlock detection, beyond the same‑thread recursive + * check above. Pass this error through for these two + * mutex types; otherwise, intentionally deadlock for + * normal mutexes. */ + return e; + } + /* ESRCH can happen only for non-robust PI mutexes where the owner of the lock died. */ assert (e != ESRCH || !robust); diff --git a/nptl/tst-deadlk-pi.c b/nptl/tst-deadlk-pi.c new file mode 100644 index 0000000000..3196a546d0 --- /dev/null +++ b/nptl/tst-deadlk-pi.c @@ -0,0 +1,2 @@ +#define TST_DEADLK_MUTEX_PI 1 +#include "tst-deadlk.c" diff --git a/nptl/tst-deadlk.c b/nptl/tst-deadlk.c new file mode 100644 index 0000000000..3a9ea8ee44 --- /dev/null +++ b/nptl/tst-deadlk.c @@ -0,0 +1,183 @@ +/* This test checks behavior not required by POSIX. */ +/* https://sourceware.org/pipermail/libc-alpha/2025-December/173431.html */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifndef TST_DEADLK_TIMEOUT +# define TST_DEADLK_TIMEOUT 10 +#endif + +#ifndef TST_DEADLK_MUTEX_PI +# define TST_DEADLK_MUTEX_PI 0 +#endif + +#define ARRAY_SIZE(Array) (sizeof (Array) / sizeof ((Array)[0])) + +#define CALL_PTHREAD_OR_FAIL(Func, ...) \ + CALL_PTHREAD_OR_EXIT (EXIT_FAILURE, Func, __VA_ARGS__) + +#define CALL_PTHREAD_OR_SKIP(Func, ...) \ + CALL_PTHREAD_OR_EXIT (EXIT_UNSUPPORTED, Func, __VA_ARGS__) + +#define CALL_PTHREAD_OR_EXIT(Status, Func, ...) \ + do \ + { \ + const int ret = Func (__VA_ARGS__); \ + if (ret > 0) \ + { \ + printf ("%s:%d: %s returned positive status %d: %s", __FILE__, \ + __LINE__, #Func, ret, strerror (ret)); \ + exit (Status); \ + } \ + } \ + while (false) + +struct howto_test +{ + int type; + bool robust; + bool prio_inherit; +}; + +struct task_context +{ + pthread_mutex_t *first, *second; + pthread_barrier_t *barrier; +}; + +static const struct howto_test howto[] = { + { .type = PTHREAD_MUTEX_ERRORCHECK, + .prio_inherit = TST_DEADLK_MUTEX_PI, + .robust = false }, + { .type = PTHREAD_MUTEX_ERRORCHECK, + .prio_inherit = TST_DEADLK_MUTEX_PI, + .robust = true }, + { .type = PTHREAD_MUTEX_RECURSIVE, + .prio_inherit = TST_DEADLK_MUTEX_PI, + .robust = false }, + { .type = PTHREAD_MUTEX_RECURSIVE, + .prio_inherit = TST_DEADLK_MUTEX_PI, + .robust = true }, +}; + +static void * +thread_function (void *const arg) +{ + const struct task_context *ctx = arg; + intptr_t ret = 0; + CALL_PTHREAD_OR_FAIL (pthread_mutex_lock, ctx->first); + CALL_PTHREAD_OR_FAIL (pthread_barrier_wait, ctx->barrier); + ret = pthread_mutex_lock (ctx->second); + CALL_PTHREAD_OR_FAIL (pthread_mutex_unlock, ctx->first); + if (ret == 0) + CALL_PTHREAD_OR_FAIL (pthread_mutex_unlock, ctx->second); + return (void *) ret; +} + +static void +initialize_mutex_or_skip_test (pthread_mutex_t *const mutex, + const struct howto_test *const how) +{ + pthread_mutexattr_t attr; + CALL_PTHREAD_OR_SKIP (pthread_mutexattr_init, &attr); + CALL_PTHREAD_OR_SKIP (pthread_mutexattr_settype, &attr, how->type); + if (how->robust) + { + CALL_PTHREAD_OR_SKIP (pthread_mutexattr_setrobust, &attr, + PTHREAD_MUTEX_ROBUST); + } + if (how->prio_inherit) + { + CALL_PTHREAD_OR_SKIP (pthread_mutexattr_setprotocol, &attr, + PTHREAD_PRIO_INHERIT); + } + CALL_PTHREAD_OR_SKIP (pthread_mutex_init, mutex, &attr); + CALL_PTHREAD_OR_SKIP (pthread_mutexattr_destroy, &attr); +} + +static void +beforehand (const struct howto_test *const how) +{ + printf ( + "Testing with this mutex: type = %d, robust = %d, prio_inherit = %d\n", + how->type, how->robust, how->prio_inherit); +} + +static int +analyze_results (const struct howto_test *const how, const int ret1, + const int ret2) +{ + if ((ret1 != EDEADLK) && (ret2 != EDEADLK)) + { + printf ("At least one thread should have gotten %d but " + "threads got %d and %d respectively.\n", + EDEADLK, ret1, ret2); + return EXIT_FAILURE; + } + else if (ret1 != 0 && ret1 != EDEADLK) + { + printf ("First thread should have gotten 0 or %d but got %d " + "instead.\n", + EDEADLK, ret1); + return EXIT_FAILURE; + } + else if (ret2 != 0 && ret2 != EDEADLK) + { + printf ("Second thread should have gotten 0 or %d but got %d " + "instead.\n", + EDEADLK, ret2); + return EXIT_FAILURE; + } + else + { + printf ("Threads got %d and %d respectively which is in line with the " + "expectation.\n", + ret1, ret2); + return EXIT_SUCCESS; + } +} + +static int +do_test (void) +{ + for (size_t i = 0; i < ARRAY_SIZE (howto); ++i) + { + pthread_t t1, t2; + pthread_mutex_t m1, m2; + void *ret1, *ret2; + pthread_barrier_t barrier; + struct task_context ctx1 + = { .first = &m1, .second = &m2, .barrier = &barrier }; + struct task_context ctx2 + = { .first = &m2, .second = &m1, .barrier = &barrier }; + beforehand (howto + i); + alarm (TST_DEADLK_TIMEOUT); + CALL_PTHREAD_OR_FAIL (pthread_barrier_init, &barrier, NULL, 2); + initialize_mutex_or_skip_test (&m1, howto + i); + initialize_mutex_or_skip_test (&m2, howto + i); + CALL_PTHREAD_OR_FAIL (pthread_create, &t1, NULL, thread_function, &ctx1); + CALL_PTHREAD_OR_FAIL (pthread_create, &t2, NULL, thread_function, &ctx2); + CALL_PTHREAD_OR_FAIL (pthread_join, t1, &ret1); + CALL_PTHREAD_OR_FAIL (pthread_join, t2, &ret2); + CALL_PTHREAD_OR_FAIL (pthread_mutex_destroy, &m1); + CALL_PTHREAD_OR_FAIL (pthread_mutex_destroy, &m2); + CALL_PTHREAD_OR_FAIL (pthread_barrier_destroy, &barrier); + alarm (0); + const int verdict + = analyze_results (howto + i, (intptr_t) ret1, (intptr_t) ret2); + if (verdict != 0) + return verdict; + } + return 0; +} + +#include