From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 25783A0566; Tue, 18 Oct 2022 09:40:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A72E4021D; Tue, 18 Oct 2022 09:40:03 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 2888940143 for ; Tue, 18 Oct 2022 09:40:02 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id n12so22036874wrp.10 for ; Tue, 18 Oct 2022 00:40:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=i/mMkO0Vym6PZpx4Pj9OvB41rkIKGBguSVjn2hLq7yE=; b=JF2iWueTHEOsZYBHf4mYIlSFs9a/OizlCHpuvQN6JbwikU6IHx6tvpw1oFrKdHNalE AXkP8FVtiQ5SlEcGzxPk1o1yNL9NZiR47NZUva6qJ9uLryuEdFjhzvOKgFB+fw35j09B Dynv6WjYdIS5/dpuOBxzCiaPNcfN6nsxnH9PkRNeYeF+sZgst+paqjHoHoZbY1XUZsZW ilY/ZK/phCeqv2gcO3Sj+UbsyHSUM21vyy4GT5y40nuxoAoxG3C6qIjUFCQJ69UWNMaM 17IsK/gbygCnhSuPWlC9KJab3Q7t5sTdqHo9h6aWzzQdVg64wfmY09LnPngGn6a1eEAF I/7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=i/mMkO0Vym6PZpx4Pj9OvB41rkIKGBguSVjn2hLq7yE=; b=LGzIT+utLUUe6rnXvikIwDqBhW3J6JUqKGaV2Z4iIiWfjwv5A2qnPnWDqxQ5jRcRA/ OrwtjS+rJH9ljNzGxJ8FX4zANa8+obDp6KFNkmC2dwX2quCiuUFYXD4RoXve8YSQqg5q z02zAJf4u+myHZY/30B1Cluzga5ULiaZ6brHxGHbAr2gqpAIm/uLeletJxmK+0bxCoPr nJxXjVcWPvEnkRjdQyeLFJ0KhhNE/w0yQvOcvwHP4MNYxeyP6GxzYDQh7elzqUXjtckq 0lmBUuBLTfuthT8KSjNRQUDU93efBO1vFNITHKmgTrwTAnqh5nuPNn8mByKJjBLvRVmg b/fQ== X-Gm-Message-State: ACrzQf2qmVf1VKBUT/YgvL4yOfPtwLb/wE4FWOZJZJyF/Ejwc9FxH3X2 zz7tN49ruPNRDp9QEKtvnB6qug== X-Google-Smtp-Source: AMsMyM6P6SXDEUr3TL8cb0fwwM03Ge9CCRzP9P1Br6hbynLfhypcUDG6ssewsPyvjgHw3GlOBs6zKg== X-Received: by 2002:a05:6000:2c4:b0:231:1b8:154 with SMTP id o4-20020a05600002c400b0023101b80154mr1043387wry.378.1666078801833; Tue, 18 Oct 2022 00:40:01 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id d20-20020a05600c34d400b003b4de550e34sm12751661wmq.40.2022.10.18.00.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 00:40:01 -0700 (PDT) Date: Tue, 18 Oct 2022 09:40:00 +0200 From: Olivier Matz To: Robin Jarry Cc: dev@dpdk.org Subject: Re: [PATCH] usertools/pmdinfo: remove dependency to ldd Message-ID: References: <20221013134125.448437-1-rjarry@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, Oct 14, 2022 at 04:02:02PM +0200, Olivier Matz wrote: > Hi Robin, > > On Thu, Oct 13, 2022 at 03:41:25PM +0200, Robin Jarry wrote: > > Some environments (buildroot) do not have the ldd utility installed by > > default. However, ldd is often only a wrapper shell script that actually > > checks that the arguments are valid ELF files and executes them with > > the LD_TRACE_LOADED_OBJECTS=1 variable set in the environment. > > > > Since ld.so is the actual ELF interpreter which is loaded first when > > executing a program, executing any dynamic ELF program/library with that > > variable set will cause all dependent dynamic libraries to be printed > > and ld.so will exit before even running main. > > > > Excerpt from ld.so(7) man page: > > > > LD_TRACE_LOADED_OBJECTS > > If set (to any value), causes the program to list its dynamic > > dependencies, as if run by ldd(1), instead of running normally. > > > > Change dpdk-pmdinfo.py to actually "execute" the files provided on the > > command line with LD_TRACE_LOADED_OBJECTS=1 set. Ensure that the files > > are valid dynamically executable ELF programs to avoid obscure and > > confusing errors. > > > > Reported-by: Olivier Matz > > Signed-off-by: Robin Jarry > > Tested on buildroot without ldd. > > Reviewed-by: Olivier Matz After some more tests, it appears that it only works for an executable binary, but it does not work for .so PMDs: # LD_TRACE_LOADED_OBJECTS=1 /usr/lib/x86_64-linux-gnu/dpdk/pmds-22.0/librte_net_ixgbe.so Segmentation fault (core dumped) So it is maybe better to keep the original code using ldd. Thank you Robin anyway.