All of lore.kernel.org
 help / color / mirror / Atom feed
* sel-logger package issue
@ 2019-11-05 12:02 Will Liang (梁永鉉)
  2019-11-05 16:31 ` Bills, Jason M
  0 siblings, 1 reply; 2+ messages in thread
From: Will Liang (梁永鉉) @ 2019-11-05 12:02 UTC (permalink / raw)
  To: James Feist, Bills, Jason M; +Cc: openbmc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sel-logger package issue
  2019-11-05 12:02 sel-logger package issue Will Liang (梁永鉉)
@ 2019-11-05 16:31 ` Bills, Jason M
  0 siblings, 0 replies; 2+ messages in thread
From: Bills, Jason M @ 2019-11-05 16:31 UTC (permalink / raw)
  To: openbmc

Hi Will,

On 11/5/2019 4:02 AM, Will Liang (梁永鉉) wrote:
> 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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-05 16:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 12:02 sel-logger package issue Will Liang (梁永鉉)
2019-11-05 16:31 ` Bills, Jason M

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.