Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ras-mc-ctl --layout makes use of unititialized values and shows 0 MB #43

Closed
evils opened this issue May 18, 2021 · 2 comments
Closed

ras-mc-ctl --layout makes use of unititialized values and shows 0 MB #43

evils opened this issue May 18, 2021 · 2 comments

Comments

@evils
Copy link
Contributor

evils commented May 18, 2021

occurs in my nix package which uses v0.6.6-21-gb4764d4 (current master HEAD) running on nixos-unstable (plus that PR)

> ras-mc-ctl --layout                                                                                   
Use of uninitialized value $max_pos[3] in modulus (%) at /run/current-system/sw/bin/ras-mc-ctl line 882.
Use of uninitialized value $d in numeric ge (>=) at /run/current-system/sw/bin/ras-mc-ctl line 883.
Use of uninitialized value $d in sprintf at /run/current-system/sw/bin/ras-mc-ctl line 886.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
Use of uninitialized value $pos[3] in join or string at /run/current-system/sw/bin/ras-mc-ctl line 805.
    +-----------------------------------------------------------------------------------------------+
    |                                              mc0                                              |
    |        csrow0         |        csrow1         |        csrow2         |        csrow3         |
    | channel0  | channel1  | channel0  | channel1  | channel0  | channel1  | channel0  | channel1  |
----+-----------------------------------------------------------------------------------------------+

0: |     0 MB  |     0 MB  |     0 MB  |     0 MB  |     0 MB  |     0 MB  |     0 MB  |     0 MB  |
----+-----------------------------------------------------------------------------------------------+

i'm not familiar with perl, but it doesn't seem impossible the perl interpreter in nixpkgs is set to be a bit more strict/verbose than the one used to develop this script

i also suspect the result of the script is incorrect, as i do in fact have memory in my system (ryzen 7 2700 with two 16gb sticks of unregistered ECC RAM on separate channels (asrock b450m pro4))

i do seem to recall getting some non-zero result from this script on NixOS on this hardware, but can't seem to replicate it, maybe this is due to now running on a newer kernel?
(i think i also set up an attempt at /etc/ras/{mainboard, dimm_labels.d} since then)

@ghost
Copy link

ghost commented Aug 11, 2021

nchatrad pushed a commit to nchatrad/rasdaemon that referenced this issue Sep 6, 2021
Removes trailing spaces at the end of a line from
file location and fixes --layout option to parse dimm nodes
to get the size of each dimm from ras-mc-ctl.

Issue is reported mchehab#43
Where '> ras-mc-ctl --layout' reports all 0s

With this change the layout option prints the correct dimm sizes
> sudo ras-mc-ctl --layout
          +-----------------------------------------------+
          |                      mc0                      |
          |  csrow0   |  csrow1   |  csrow2   |  csrow3   |
----------+-----------------------------------------------+
...
channel7: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
channel6: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
...
----------+-----------------------------------------------+

Signed-off-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lkml.kernel.org/r/20210810183855.129076-1-nchatrad@amd.com/
muralimk51 pushed a commit to muralimk51/rasdaemon that referenced this issue Sep 6, 2021
Removes trailing spaces at the end of a line from
file location and fixes --layout option to parse dimm nodes
to get the size of each dimm from ras-mc-ctl.

Issue is reported mchehab#43
Where '> ras-mc-ctl --layout' reports all 0s

With this change the layout option prints the correct dimm sizes
> sudo ras-mc-ctl --layout
          +-----------------------------------------------+
          |                      mc0                      |
          |  csrow0   |  csrow1   |  csrow2   |  csrow3   |
----------+-----------------------------------------------+
...
channel7: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
channel6: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
...
----------+-----------------------------------------------+

Signed-off-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Link: https://lkml.kernel.org/r/20210810183855.129076-1-nchatrad@amd.com/
mchehab pushed a commit that referenced this issue Apr 1, 2022
Removes trailing spaces at the end of a line from
file location and fixes --layout option to parse dimm nodes
to get the size of each dimm from ras-mc-ctl.

Issue is reported #43
Where '> ras-mc-ctl --layout' reports all 0s

With this change the layout option prints the correct dimm sizes
> sudo ras-mc-ctl --layout
          +-----------------------------------------------+
          |                      mc0                      |
          |  csrow0   |  csrow1   |  csrow2   |  csrow3   |
----------+-----------------------------------------------+
...
channel7: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
channel6: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
...
----------+-----------------------------------------------+

Signed-off-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lkml.kernel.org/r/20210810183855.129076-1-nchatrad@amd.com/
@evils
Copy link
Contributor Author

evils commented Nov 2, 2022

this appears to be fixed in 0.6.8

@evils evils closed this as completed Nov 2, 2022
RocheWilliam pushed a commit to RocheWilliam/rasdaemon that referenced this issue Jul 7, 2023
Removes trailing spaces at the end of a line from
file location and fixes --layout option to parse dimm nodes
to get the size of each dimm from ras-mc-ctl.

Issue is reported mchehab#43
Where '> ras-mc-ctl --layout' reports all 0s

With this change the layout option prints the correct dimm sizes
> sudo ras-mc-ctl --layout
          +-----------------------------------------------+
          |                      mc0                      |
          |  csrow0   |  csrow1   |  csrow2   |  csrow3   |
----------+-----------------------------------------------+
...
channel7: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
channel6: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
...
----------+-----------------------------------------------+

Signed-off-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Cc: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lkml.kernel.org/r/20210810183855.129076-1-nchatrad@amd.com/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant