Closed duagon-rvw closed 1 year ago
Ok. So we have been seeing this error inconsistently when running our tests. The main issue is that the parsing of a chameleon table with scan_system.sh
ends up always parsing an empty line. We thought the inconsistencies may come from different dumps of the chameleon tables read but it turns out the inconsistencies of the error come from different distributions when doing this 16#XX
bash command. So in one distro, an empty value of devId
in the expression ipcoreId="$((16#${devid}))"
does not error and the others do:
It does not error when:
men@men-F027:/tmp$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
men@men-F027:/tmp$ echo $((16#FF))
255
men@men-F027:/tmp$ echo $((16#))
0
But it does error here:
men@men-a25:/tmp$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
men@men-a25:/tmp$
men@men-a25:/tmp$ echo $((16#FF))
255
men@men-a25:/tmp$ echo $((16#))
-bash: 16#: invalid integer constant (error token is "16#")
So we can just add a double check so that the script does not try to parse empty lines.
There is a possibility for
scan_system.sh
to error out in line 568 (The line is identical on mad-dev)://opt/menlinux/scan_system.sh: line 568: 16#: invalid integer constant (error token is "16#")
The line in Question:
What the line is trying to do is to convert
devid
from base16 to base10. Whendevid
is empty, this error occurs. You can reproduce this with bash like this:bash -c 'echo $((16#))'
Please check if this is already fixed.
Some more infos from the customer:
HW:
We have 0701-0126 duadon device and placed F26L, F403 G227, G211X on it.
When looking at the code, I guess there is something going wrong with the parsing of the chameleon table.