From: David Marchand <david.marchand@redhat.com>
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: dev <dev@dpdk.org>, Zhihong Peng <zhihongx.peng@intel.com>,
Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [dpdk-dev] [PATCH] pmdinfogen: allow padding after NUL terminator
Date: Thu, 27 May 2021 09:31:57 +0200 [thread overview]
Message-ID: <CAJFAV8zaWd6jWTrZWMgePkK6RVZf3H19+gWKEvxNdDYUYK8U4Q@mail.gmail.com> (raw)
In-Reply-To: <20210526214343.31352-1-dmitry.kozliuk@gmail.com>
On Wed, May 26, 2021 at 11:44 PM Dmitry Kozlyuk
<dmitry.kozliuk@gmail.com> 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 <dmitry.kozliuk@gmail.com>
> ---
> 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 <module>
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 <module>
subprocess.run(pmdinfogen + paths + [output], check=True)
File "c:\python38\lib\subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
--
David Marchand
next prev parent reply other threads:[~2021-05-27 7:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 21:43 [dpdk-dev] [PATCH] pmdinfogen: allow padding after NUL terminator Dmitry Kozlyuk
2021-05-27 6:53 ` David Marchand
2021-05-27 7:09 ` Dmitry Kozlyuk
2021-05-27 7:31 ` David Marchand [this message]
2021-05-27 21:24 ` [dpdk-dev] [PATCH v2] " Dmitry Kozlyuk
2021-06-09 15:52 ` Dmitry Kozlyuk
2021-06-09 16:01 ` [dpdk-dev] [dpdk-ci] " Lincoln Lavoie
2021-06-09 16:48 ` Dmitry Kozlyuk
2021-06-09 17:19 ` Owen Hilyard
2021-06-18 14:39 ` [dpdk-dev] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJFAV8zaWd6jWTrZWMgePkK6RVZf3H19+gWKEvxNdDYUYK8U4Q@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=dmitry.kozliuk@gmail.com \
--cc=nhorman@tuxdriver.com \
--cc=zhihongx.peng@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.