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 B07F6A0546; Thu, 27 May 2021 09:32:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39E5E40150; Thu, 27 May 2021 09:32:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 5677340143 for ; Thu, 27 May 2021 09:32:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622100733; 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: in-reply-to:in-reply-to:references:references; bh=ZIK4mUICMPERC0O4iVFrF9QAbEKb4WUFnAMl4KWEqGw=; b=Kc2bDaq+UcqZ7NVhqjW87iTaeWHmFX8JV1LbKn5ARQF9dOmRRsHPyDpmKqGoe9Mu2gBzHz J+JpqQX3mBmSOIJz+AZdFTbotusJCn7+p9/zAXX/JZW+6EeekXu1NehA7F5H8ph1LbO0BV HW27SglsNUvuUYNnhCP/rriwgtDyAB4= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-134-Yay49LNVP4OzUQ_uCv867g-1; Thu, 27 May 2021 03:32:09 -0400 X-MC-Unique: Yay49LNVP4OzUQ_uCv867g-1 Received: by mail-ua1-f69.google.com with SMTP id c27-20020ab0079b0000b0290217cf59726cso1718063uaf.10 for ; Thu, 27 May 2021 00:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZIK4mUICMPERC0O4iVFrF9QAbEKb4WUFnAMl4KWEqGw=; b=o9uc3MU8S+Sd49PIjjGS6B1ytuH8aReHo33c2gXgeHo2myr+t5zgKM0wtF/OK+3PD5 l3GBSlQqJbYW8CHZj3RqKxK8HBallFue3LT23XL85l+j9KrvuWnSm8sYCIAwEUrCdBB3 uAoXtmOYNK9JZJzFOTUgM3StmYCU6EGLcSH6uJHM98euCsdafpDs5pmLVGb92BRr8XB1 9uRzw9H0/HTQ2YwwkwUsZykyX09SB469WNO851/RgL/RZqQJJEu7DYy8sKJyRfZl+beJ crfRBRjZHM6cbpwZyN3hKnY1GcHRqqq2WJDyQ6vQR4I7PW/iWQ+pimLrFkAytlAGapaq fZkg== X-Gm-Message-State: AOAM53223o84IuuB3aRSzHXn+KQ4uVBRw5TOXazZACmP7GQKaSSNySR0 8uxUbrN1WaeVc+eJGAQAmp7YjBaeQqHJCVF/8KPm8kqBKEgkzl1UHeyhjnGQqyi2xZenZNxrcc+ TzWAKhCJC/IUivvItZnk= X-Received: by 2002:a1f:3816:: with SMTP id f22mr1123170vka.17.1622100729057; Thu, 27 May 2021 00:32:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN8oznz+s6wXD7TL2gdwXRvlFu7HrZOUKPFa3es+OeKLgCHjttKN4uMef/YU1iMCqPv6tigadpWjLpPWS1bUM= X-Received: by 2002:a1f:3816:: with SMTP id f22mr1123165vka.17.1622100728879; Thu, 27 May 2021 00:32:08 -0700 (PDT) MIME-Version: 1.0 References: <20210526214343.31352-1-dmitry.kozliuk@gmail.com> In-Reply-To: <20210526214343.31352-1-dmitry.kozliuk@gmail.com> From: David Marchand Date: Thu, 27 May 2021 09:31:57 +0200 Message-ID: To: Dmitry Kozlyuk Cc: dev , Zhihong Peng , Neil Horman Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] pmdinfogen: allow padding after NUL terminator 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 Sender: "dev" On Wed, May 26, 2021 at 11:44 PM Dmitry Kozlyuk wrote: > > Size of string constant symbol may be larger than its length > measured up to NUL terminator. In this case pmdinfogen included padding > bytes after NUL terminator in generated source, yielding incorrect code. > > Always trim string data to NUL terminator while reading ELF. > It was already done for COFF because there's no symbol size. > > Bugzilla ID: 720 > Fixes: f0f93a7adfee ("buildtools: use Python pmdinfogen") > > Signed-off-by: Dmitry Kozlyuk > --- > buildtools/coff.py | 6 ------ > buildtools/pmdinfogen.py | 10 ++++++++-- > 2 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/buildtools/coff.py b/buildtools/coff.py > index 86fb0602b7..a7b6c37e32 100644 > --- a/buildtools/coff.py > +++ b/buildtools/coff.py > @@ -146,9 +146,3 @@ def get_section_data(self, number): > > def get_string(self, offset): > return decode_asciiz(self._strings[offset:]) ^^^^ coff.py still needs this helper. Caught in the lab: Traceback (most recent call last): File "../buildtools/pmdinfogen.py", line 280, in main() File "../buildtools/pmdinfogen.py", line 275, in main drivers = load_drivers(image) File "../buildtools/pmdinfogen.py", line 208, in load_drivers for symbol in image.find_by_prefix("this_pmd_name"): File "../buildtools/pmdinfogen.py", line 108, in find_by_prefix if symbol.name.startswith(prefix): File "C:\Users\builder\jenkins\workspace\Windows-Compile-DPDK-Mingw64\dpdk\buildtools\coff.py", line 84, in name return decode_asciiz(bytes(self._coff.name.immediate)) NameError: name 'decode_asciiz' is not defined Traceback (most recent call last): File "../buildtools/gen-pmdinfo-cfile.py", line 20, in subprocess.run(pmdinfogen + paths + [output], check=True) File "c:\python38\lib\subprocess.py", line 512, in run raise CalledProcessError(retcode, process.args, -- David Marchand