devtools: fix version variable not initialized

Message ID 20240417093236.3786106-1-huangdengdui@huawei.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series devtools: fix version variable not initialized |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

huangdengdui April 17, 2024, 9:32 a.m. UTC
  The version variable is not initialized. Therefore, if the -V option
is not specified, the value of $version is obtained from the context,
which may cause the version map parsing failure.

Fixes: 6edec7f202ac ("devtools: list symbols by version")
Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
---
 buildtools/map-list-symbol.sh | 1 +
 1 file changed, 1 insertion(+)
  

Comments

David Marchand June 27, 2024, 2:28 p.m. UTC | #1
On Wed, Apr 17, 2024 at 11:32 AM Dengdui Huang <huangdengdui@huawei.com> wrote:
>
> The version variable is not initialized. Therefore, if the -V option
> is not specified, the value of $version is obtained from the context,
> which may cause the version map parsing failure.
>
> Fixes: 6edec7f202ac ("devtools: list symbols by version")
> Cc: stable@dpdk.org
>
> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>

This is an internal script and I wonder how the mentionned issue is hit.
In any case this fix is correct.

Reviewed-by: David Marchand <david.marchand@redhat.com>
  
huangdengdui June 28, 2024, 6:55 a.m. UTC | #2
On 2024/6/27 22:28, David Marchand wrote:
> On Wed, Apr 17, 2024 at 11:32 AM Dengdui Huang <huangdengdui@huawei.com> wrote:
>>
>> The version variable is not initialized. Therefore, if the -V option
>> is not specified, the value of $version is obtained from the context,
>> which may cause the version map parsing failure.
>>
>> Fixes: 6edec7f202ac ("devtools: list symbols by version")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> 
> This is an internal script and I wonder how the mentionned issue is hit.
> In any case this fix is correct.
> 
> Reviewed-by: David Marchand <david.marchand@redhat.com>
> 
> 

Thanks for your review.

The project build script may pass version information through environment variables.
This problem occurs if the following execution sequence exists:

export version=devel
meson build
ninja -C build
  
David Marchand July 9, 2024, 4:51 a.m. UTC | #3
On Thu, Jun 27, 2024 at 4:28 PM David Marchand
<david.marchand@redhat.com> wrote:
> On Wed, Apr 17, 2024 at 11:32 AM Dengdui Huang <huangdengdui@huawei.com> wrote:
> >
> > The version variable is not initialized. Therefore, if the -V option
> > is not specified, the value of $version is obtained from the context,
> > which may cause the version map parsing failure.
> >
> > Fixes: 6edec7f202ac ("devtools: list symbols by version")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.
  

Patch

diff --git a/buildtools/map-list-symbol.sh b/buildtools/map-list-symbol.sh
index bc3b8d766f..43f276c05f 100755
--- a/buildtools/map-list-symbol.sh
+++ b/buildtools/map-list-symbol.sh
@@ -5,6 +5,7 @@ 
 section=all
 symbol=all
 quiet=
+version=
 
 while getopts 'S:s:qV:' name; do
 	case $name in