Skip to contentSkip to conversation

sel-logger package issue

DISCUSSION Will Liang (梁永鉉) 2 participants 2 messages Nov 5, 2019

lore
Share & tools
lore
#0 lore raw

Hi,

I found that the sel-logger service crashed when the "Value out of range"[1] exception occurred.

[1]https://github.com/openbmc/phosphor-sel-logger/blob/6afe9560852c6431c43c8e79a28e2b7cb498e355/include/sensorutils.hpp#L166

It is because the try-catch[2] does not catch the exception type(std::out_of_range).
Therefore, you can change the catch type to "std::exception" to catch all the exception or only catch the "std::out_of_range" type.

[2]https://github.com/openbmc/phosphor-sel-logger/blob/6afe9560852c6431c43c8e79a28e2b7cb498e355/include/threshold_event_monitor.hpp#L162

BRs,
Will

#1 lore raw

Hi Will,

Quoted 8 lines · Will Liang (梁永鉉)

Hi,

I found that the sel-logger service crashed when the "Value out of range"[1] exception occurred.

[1]https://github.com/openbmc/phosphor-sel-logger/blob/6afe9560852c6431c43c8e79a28e2b7cb498e355/include/sensorutils.hpp#L166

It is because the try-catch[2] does not catch the exception type(std::out_of_range).
Therefore, you can change the catch type to "std::exception" to catch all the exception or only catch the "std::out_of_range" type.

Good catch! Since the error message is generic, I'm okay with catching std::exception (unless others have strong feelings about it). Please submit a patch with the fix.

Thanks!
-Jason

Quoted 7 lines

[2]https://github.com/openbmc/phosphor-sel-logger/blob/6afe9560852c6431c43c8e79a28e2b7cb498e355/include/threshold_event_monitor.hpp#L162

BRs,
Will