minor status file annotation fixes (#19723)
* minor status file annotation fixes * avoid duplicate cause
Costa Tsaousis committed
Feb 26, 2025 at 23:07 UTC
dc8b731c47f138d48032d6693b9270b6bb5f6bdc
1 file changed
+12
-12
src/daemon/daemon-status-file.c
+12
-12
@@ -711,16 +711,16 @@ void daemon_status_file_check_crash(void) {
711
msg = "The system was abnormally powered off while Netdata was starting";
712
pri = PRI_USER_SHOULD_FIX;
713
}
714
- else if (last_session_status.exit_reason &= (EXIT_REASON_SIGBUS|EXIT_REASON_SIGFPE|EXIT_REASON_SIGILL|EXIT_REASON_SIGSEGV)) {
715
- cause = "killed signal";
716
- msg = "Netdata was last crashed while starting, with a signal indicating a bug";
717
- pri = PRI_NETDATA_BUG;
718
- }
719
- else if (last_session_status.exit_reason &= EXIT_REASON_OUT_OF_MEMORY) {
714
+ else if (last_session_status.exit_reason & EXIT_REASON_OUT_OF_MEMORY) {
715
cause = "out of memory";
716
msg = "Netdata was last crashed while starting, because it couldn't allocate memory";
717
pri = PRI_USER_SHOULD_FIX;
718
}
719
+ else if (!is_exit_reason_normal(last_session_status.exit_reason)) {
720
+ cause = "fatal on start";
721
+ msg = "Netdata was last crashed while starting, because of a fatal error";
722
+ pri = PRI_NETDATA_BUG;
723
+ }
724
else {
725
cause = "crashed on start";
726
msg = "Netdata was last killed/crashed while starting";
@@ -760,16 +760,16 @@ void daemon_status_file_check_crash(void) {
760
msg = "The system was abnormally powered off while Netdata was running";
761
pri = PRI_USER_SHOULD_FIX;
762
}
763
- else if (last_session_status.exit_reason &= (EXIT_REASON_SIGBUS|EXIT_REASON_SIGFPE|EXIT_REASON_SIGILL|EXIT_REASON_SIGSEGV)) {
764
- cause = "killed signal";
765
- msg = "Netdata was last crashed with a signal indicating a bug";
766
- pri = PRI_NETDATA_BUG;
767
- }
768
- else if (last_session_status.exit_reason &= EXIT_REASON_OUT_OF_MEMORY) {
763
+ else if (last_session_status.exit_reason & EXIT_REASON_OUT_OF_MEMORY) {
764
cause = "out of memory";
765
msg = "Netdata was last crashed because it couldn't allocate memory";
766
pri = PRI_USER_SHOULD_FIX;
767
}
768
+ else if (!is_exit_reason_normal(last_session_status.exit_reason)) {
769
+ cause = "killed fatal";
770
+ msg = "Netdata was last crashed due to a fatal error";
771
+ pri = PRI_NETDATA_BUG;
772
+ }
773
else {
774
cause = "killed hard";
775
msg = "Netdata was last killed/crashed while operating normally";