From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by sourceware.org (Postfix) with ESMTPS id 829FD3858D20 for ; Sun, 26 Mar 2023 00:28:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 829FD3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=flex--ppluzhnikov.bounces.google.com Received: by mail-pl1-x649.google.com with SMTP id l14-20020a170902f68e00b001a1a9a1d326so3460224plg.9 for ; Sat, 25 Mar 2023 17:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679790483; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=Q+zcvEEYo+obSm0K3nkffZ2x/Fv441wbcs7tmv68+T8=; b=B3a6LeqdfFCpBhmtQVcDmKJHeMvQ4SpnifMmSE+bGteoCPkDcdkbSpVpGjEpSe0zZA ZPHcBHfdszTu8T1JZZf7GHgRvF40HA2rdO4n2Qg58GdBZVbUSmujq2gUJ+bteJBS0Q1+ UFJWxF6G43W7G+Z5N2ueRUtqaI3vBb3CjXyaGwn8i4BUXAHOzmW2cRactzS6xtolpAOT O7PafMNTcXbvIhpJmiC8JHQD4ZhAHxYwdKJRUzlHnoiJWMSjDS3YI05hdU78duTdHSm1 qghYpeTrNf6QQR8BhMQzxoLuSkIsYlHaoVgUSEJD/vk33bd0LatKdRSU9jvtvQVS0//P 90Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679790483; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=Q+zcvEEYo+obSm0K3nkffZ2x/Fv441wbcs7tmv68+T8=; b=BoxmVqFkBTGE4Ok2QPeHE2q4o4jUAjtLyHWu9jotS7Yk6fkIDVnpVUUfA41YhGrYW0 CDSBkhsyZOvhW/Z8bU72bh7RfQTdriApqC5ANMz+p24jK8H9SJIM5Qsr3sN84CSzV6oD 5IuTFQ0ODKn/srYcDlY85pDAAOEQy1R3XfPfY7r6seciTcmE5h2P+uEWJmOdlixqA9CV YG3OQ4WgGwyN20OGkYp93BeM7iS8+BibqrDF2Iz/QnqMgKZcznok3eH2lo6/N8dGl299 0vf8brFB/fnMEwijfCiil7Yhktbv+ocfBJRG1d/Gua/2im01DFazQVnc88qDjg9RW0S+ NEHA== X-Gm-Message-State: AAQBX9eEuReANwKzi8cEOBuFEJYw3oCThOmYKOH5Tbw11MsknqFrdXIV Pe2iiw1sOdYw4X/pCIjlAd6IxpWW2qu5Cf5PUZf7ClogI7w7Y9V5+DP/Pc3IS//ATeK2eOPotu3 aTXugi0+LxIk3NoAdJQWcGskk0dg/tNI8aLzpRaIAC91r4ZEVuN7i5z+JbWwGHN6lD7chRgNppa LgtMY= X-Google-Smtp-Source: AKy350YNaKaTruF8UKXGTbLnz6NK/BLTkXAAyZsKyWTo2VWGmca1k5dC9TT20HJNq+4Wp+q7GJ1WoKDRvHzO1Y7CoA== X-Received: from elbrus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:12e9]) (user=ppluzhnikov job=sendgmr) by 2002:a63:c1f:0:b0:513:477e:5ccb with SMTP id b31-20020a630c1f000000b00513477e5ccbmr388245pgl.12.1679790483402; Sat, 25 Mar 2023 17:28:03 -0700 (PDT) Date: Sun, 26 Mar 2023 00:24:00 +0000 In-Reply-To: <87h6u8xz2y.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 References: <87h6u8xz2y.fsf@mid.deneb.enyo.de> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230326002358.1244787-1-ppluzhnikov@google.com> Subject: [PATCH] Minor: don't call _dl_debug_update (which can have side effects) inside assert From: Paul Pluzhnikov To: libc-alpha@sourceware.org Cc: Paul Pluzhnikov , Florian Weimer , Andreas Schwab Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-19.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL 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 Sat, Mar 25, 2023 at 3:09=E2=80=AFPM Florian Weimer w= rote: > This needs __attribute__ ((unused)) on r_state to support building > with -DNDEBUG (although I have not tested that). Thanks. Revised patch included. --- elf/dl-open.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/elf/dl-open.c b/elf/dl-open.c index 91a2d8a538..2d985e21d8 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -578,7 +578,9 @@ dl_open_worker_begin (void *a) if ((mode & RTLD_GLOBAL) && new->l_global =3D=3D 0) add_to_global_update (new); =20 - assert (_dl_debug_update (args->nsid)->r_state =3D=3D RT_CONSISTENT)= ; + const int r_state __attribute__ ((unused)) + =3D _dl_debug_update (args->nsid)->r_state; + assert (r_state =3D=3D RT_CONSISTENT); =20 return; } @@ -927,7 +929,9 @@ no more namespaces available for dlmopen()")); _dl_signal_exception (errcode, &exception, NULL); } =20 - assert (_dl_debug_update (args.nsid)->r_state =3D=3D RT_CONSISTENT); + const int r_state __attribute__ ((unused)) + =3D _dl_debug_update (args.nsid)->r_state; + assert (r_state =3D=3D RT_CONSISTENT); =20 /* Release the lock. */ __rtld_lock_unlock_recursive (GL(dl_load_lock)); --=20 2.40.0.348.gf938b09366-goog