Fix crash if port_rcv_data contains "N/A (no PMA)"#187
Merged
pgier merged 1 commit intoprometheus:masterfrom Jun 27, 2019
Merged
Fix crash if port_rcv_data contains "N/A (no PMA)"#187pgier merged 1 commit intoprometheus:masterfrom
pgier merged 1 commit intoprometheus:masterfrom
Conversation
In case `port_rcv_data` contains `N/A (no PMA)`, `vp.PUInt64` returns `nil` which is assigned to `counters.PortRcvData`. Then the content of `counters.PortRcvData` cannot be multiplied by four. The program will fail with: ``` panic: runtime error: invalid memory address or nil pointer dereference ``` Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
Member
|
Wondering if we could handle that better in the value parser but possibly not, so LGTM either way. |
discordianfish
approved these changes
Jun 26, 2019
Contributor
Author
|
Alternatively the value parser could accept a function that it applies on the value before returning it. |
bdrung
added a commit
to bdrung/node_exporter
that referenced
this pull request
Jul 1, 2019
procfs v0.0.4-0.20190627154503-39e1aff1547e is a requirement for prometheus#1357 (because procfs v0.0.3 contained bug prometheus/procfs#187) Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
SuperQ
pushed a commit
to prometheus/node_exporter
that referenced
this pull request
Jul 1, 2019
procfs v0.0.4-0.20190627154503-39e1aff1547e is a requirement for #1357 (because procfs v0.0.3 contained bug prometheus/procfs#187) Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
bobrik
pushed a commit
to bobrik/procfs
that referenced
this pull request
Jan 14, 2023
Fix build.rs to allow cross-compilation
oblitorum
pushed a commit
to shatteredsilicon/node_exporter
that referenced
this pull request
Apr 9, 2024
procfs v0.0.4-0.20190627154503-39e1aff1547e is a requirement for prometheus#1357 (because procfs v0.0.3 contained bug prometheus/procfs#187) Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
oblitorum
pushed a commit
to shatteredsilicon/node_exporter
that referenced
this pull request
Apr 9, 2024
procfs v0.0.4-0.20190627154503-39e1aff1547e is a requirement for prometheus#1357 (because procfs v0.0.3 contained bug prometheus/procfs#187) Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case
port_rcv_datacontainsN/A (no PMA),vp.PUInt64returnsnilwhich is assigned tocounters.PortRcvData. Then the content ofcounters.PortRcvDatacannot be multiplied by four. The program will fail with:This issue was found by the tests in prometheus/node_exporter#1396