[Crash-utility] regression: crash --minimal "log" command spins at 100% cpu after c86250bce29f Introduction of the "log -T" option

David Wysochanski dwysocha at redhat.com
Tue Aug 4 12:51:37 UTC 2020


This patch broke running "log" command when "crash --minimal" is
invoked for any vmcore.  This is important because sometimes there is
a damaged vmcore and the log is enough to diagnose the problem.

It looks like this is the result of this code block where machdep->hz
== 0 and we divide by 0:
@@ -4936,6 +4939,15 @@ cmd_log(void)
         if (argerrs)
                 cmd_usage(pc->curcmd, SYNOPSIS);

+       if (kt->boot_date.tv_sec == 0) {
+               ulonglong uptime_jiffies;
+               ulong  uptime_sec;
+               get_uptime(NULL, &uptime_jiffies);
+               uptime_sec = (uptime_jiffies)/(ulonglong)machdep->hz;
+               kt->boot_date.tv_sec = kt->date.tv_sec - uptime_sec;
+               kt->boot_date.tv_nsec = 0;
+       }
+


I am not sure what the correct approach is here but wanted to report
this regression.  Also wanted to ask whether this project has
considered any sort of CI tests to run on checkins.

Thanks.




More information about the Crash-utility mailing list