From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 88B663858403 for ; Fri, 9 Feb 2024 14:53:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 88B663858403 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 88B663858403 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707490424; cv=none; b=RvRCfz6xXeOjFn5rX9bEhEoKX28yikAYL9W7pTP6WpTlceHOgNQlKxU1GpNz/BTNVFOkJ5zBBxCbbCsqK3VS+31HqdF/pxZxDdr2CgOxnk2GbLT4Z6m1dpHGMYjlapdOQeZY1YoJdh88U8wHnQ3p4PCL/hfSt2z2f3egq7/gLkI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707490424; c=relaxed/simple; bh=D2A4ODmCui48bmu59LMxNR3+UkBcK5/Keey9A8HfHXI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=sT+PWdjlwxWTHMPosdMidMS4n3m0wnQhdXG3mddsPrNNs75YG3yNZBlhxCVDDV1MrbP+UB2wPuaOEX7XEmF3DbbqJs7c2uhKcXv1piSD4dOfOtuEOHprGxNi6PhD01c85lLwcjsOrx6FW/s9Vnly6Ll6z2W4CfgsJ38UtBqs56E= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707490422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6k6lEOvesupfMeK/M+lDteNSYVjdeOIlGjtj6S/ONoc=; b=XDO6mySqWq4IV0Zdvi9xGTvbeKe46IWQMJmu7swNmuylpEZZeXLegQOgVvL9mf+p1eCRqd kbkdkxPPvCT6/TPcv9nOkzh1LVmxWUFnFPNmwPYGH0zMUkOHecvEJXEJjnxIXudhcgA3KP aqpCMiDaEsXap4eryDS75jbh5/d7pNI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-564-i9r6lJv_O3aAGMZkjc2XSQ-1; Fri, 09 Feb 2024 09:53:40 -0500 X-MC-Unique: i9r6lJv_O3aAGMZkjc2XSQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AE08185A786; Fri, 9 Feb 2024 14:53:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.58]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 04FEB492BE2; Fri, 9 Feb 2024 14:53:39 +0000 (UTC) From: Florian Weimer To: "H.J. Lu" Cc: Andreas Schwab , libc-alpha@sourceware.org Subject: Re: [PATCH] elf: Properly remove the initial 'env' command References: <20240209125449.2352780-1-hjl.tools@gmail.com> <87mss9aicg.fsf@igel.home> <87bk8p7oki.fsf@oldenburg.str.redhat.com> Date: Fri, 09 Feb 2024 15:53:38 +0100 In-Reply-To: (H. J. Lu's message of "Fri, 9 Feb 2024 05:52:59 -0800") Message-ID: <87o7cp664t.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * H. J. Lu: > On Fri, Feb 9, 2024 at 5:30=E2=80=AFAM Florian Weimer wrote: >> >> * Andreas Schwab: >> >> > On Feb 09 2024, H.J. Lu wrote: >> > >> >> diff --git a/elf/tst-rtld-list-diagnostics.py b/elf/tst-rtld-list-dia= gnostics.py >> >> index 9e70e74bf8..dfba94de64 100644 >> >> --- a/elf/tst-rtld-list-diagnostics.py >> >> +++ b/elf/tst-rtld-list-diagnostics.py >> >> @@ -294,7 +294,11 @@ def main(argv): >> >> check_consistency_with_manual(opts.manual) >> >> >> >> # Remove the initial 'env' command. >> >> - parse_diagnostics(opts.command.split()[1:]) >> >> + options =3D [] >> >> + for o in opts.command.split()[0:]: >> >> + if o !=3D 'env': >> >> + options.append(o) >> > >> > Why does it need to do that in the first place? >> >> Good question. I must have copied it from scripts/tst-ld-trace.py. I >> think we can remove the .split() and run the command string with > > How does removing .split() work? The argument is > > "/export/build/gnu/tools-build/glibc-apx-sde/test-sde.sh env > /export/build/gnu/tools-build/glibc-apx-sde/build-x86_64-linux/elf/ld-lin= ux-x86-64.so.2 > --list-diagnostics" > > We need .split() to change it to proper arguments. Can you test this? diff --git a/elf/tst-rtld-list-diagnostics.py b/elf/tst-rtld-list-diagnosti= cs.py index 9e70e74bf8..024bd8c320 100644 --- a/elf/tst-rtld-list-diagnostics.py +++ b/elf/tst-rtld-list-diagnostics.py @@ -222,7 +222,7 @@ else: def parse_diagnostics(cmd): global errors diag_out =3D subprocess.run(cmd, stdout=3Dsubprocess.PIPE, check=3DTru= e, - universal_newlines=3DTrue).stdout + universal_newlines=3DTrue, shell=3DTrue).std= out if diag_out[-1] !=3D '\n': print('error: ld.so output does not end in newline') errors +=3D 1 @@ -293,8 +293,7 @@ def main(argv): if opts.manual: check_consistency_with_manual(opts.manual) =20 - # Remove the initial 'env' command. - parse_diagnostics(opts.command.split()[1:]) + parse_diagnostics(opts.command) =20 if errors: sys.exit(1) Thanks, Florian