My Ubuntu 18.04 system randomly freezes for several seconds and then reboots. Sometimes it's okay for a week or two, and sometimes it happens twice in the same day:
===== 2019-06-27 20:58:30 -0400 Thu
===== 2019-06-28 09:31:13 -0400 Fri
===== 2019-06-29 12:39:59 -0400 Sat
===== 2019-07-02 08:45:18 -0400 Tue
===== 2019-07-07 00:11:12 -0400 Sun
===== 2019-07-10 01:18:48 -0400 Wed
===== 2019-07-10 01:23:30 -0400 Wed
===== 2019-07-18 20:42:12 -0400 Thu
===== 2019-07-22 09:23:59 -0400 Mon
===== 2019-07-22 19:47:52 -0400 Mon
===== 2019-07-22 20:50:15 -0400 Mon
===== 2019-07-23 19:30:48 -0400 Tue
===== 2019-07-24 18:48:29 -0400 Wed
===== 2019-07-25 19:52:52 -0400 Thu
Tonight it happened when I wasn't even home, so it was basically doing nothing at the time.
All the software has been updated recently ("apt update" and "apt upgrade").
I've been logging the temperature at reboot time, and it's typically not especially high. E.g.:
Package id 0: +65.0°C (high = +100.0°C, crit = +100.0°C)
Core 0: +65.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +64.0°C (high = +100.0°C, crit = +100.0°C)
temp1: +53.0°C
It has 16G of memory, so there's lots available.
I replaced the memory card recently to see if that could be causing it, but the change had no effect.
/var/adm/syslog shows little activity, and then suddenly shows the reboot.
This time, shortly before the reboot, there were error messages from "gsd-housekeepin", but that's not always the case.
There are no message after that (19:49:23) for another 3 minutes, and then the reboot at (19:52:52):
...
Jul 25 19:20:34 ray-desktop org.gnome.Shell.desktop[1568]: #23 0x7ffc1c6d7730 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7f72c84b5de0 @ 71)
Jul 25 19:20:34 ray-desktop org.gnome.Shell.desktop[1568]: #24 0x562f516643f0 i resource:///org/gnome/shell/ui/screenShield.js:854 (0x7f72abc505e8 @ 25)
Jul 25 19:20:34 ray-desktop gnome-software[1961]: no app for changed [email protected]
Jul 25 19:20:34 ray-desktop gnome-software[1961]: no app for changed [email protected]
Jul 25 19:25:01 ray-desktop CRON[26107]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 25 19:35:01 ray-desktop CRON[26181]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 25 19:45:01 ray-desktop CRON[26247]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-rtkit-daemon.service-rOQu2D: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-rtkit-daemon.service-rOQu2D': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-colord.service-3zmTxO: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-colord.service-3zmTxO': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-fwupd.service-P4UoAn: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-fwupd.service-P4UoAn': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-bolt.service-dsge7s: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-bolt.service-dsge7s': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-ModemManager.service-1PtGCs: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-ModemManager.service-1PtGCs': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-resolved.service-vNNHBN: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-resolved.service-vNNHBN': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-timesyncd.service-ftiEu9: Error opening directory '/var/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-timesyncd.service-ftiEu9': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/.com.google.Chrome.deklZp: Error opening directory '/tmp/.com.google.Chrome.deklZp': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-bolt.service-a96unv: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-bolt.service-a96unv': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-resolved.service-qLTayY: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-resolved.service-qLTayY': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-rtkit-daemon.service-kv3biJ: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-rtkit-daemon.service-kv3biJ': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-ModemManager.service-EO4b7C: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-ModemManager.service-EO4b7C': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-timesyncd.service-awJNrk: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-systemd-timesyncd.service-awJNrk': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-fwupd.service-SoSJWr: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-fwupd.service-SoSJWr': Permission denied
Jul 25 19:49:23 ray-desktop gsd-housekeepin[1722]: Failed to enumerate children of /tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-colord.service-EcYRyY: Error opening directory '/tmp/systemd-private-cb9f998457344f9ea2b392c8a5517e35-colord.service-EcYRyY': Permission denied
Jul 25 19:52:52 ray-desktop systemd-modules-load[257]: Inserted module 'lp'
Jul 25 19:52:52 ray-desktop blkmapd[292]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory
Jul 25 19:52:52 ray-desktop systemd-modules-load[257]: Inserted module 'ppdev'
Jul 25 19:52:52 ray-desktop systemd-modules-load[257]: Inserted module 'parport_pc'
Jul 25 19:52:52 ray-desktop systemd-modules-load[257]: Inserted module 'coretemp'
Jul 25 19:52:52 ray-desktop systemd-sysctl[290]: Couldn't write '10' to 'sysctl vm/swappiness', ignoring: No such file or directory
Jul 25 19:52:52 ray-desktop systemd[1]: Starting Flush Journal to Persistent Storage...
Jul 25 19:52:52 ray-desktop systemd[1]: Started udev Kernel Device Manager.
Jul 25 19:52:52 ray-desktop systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
Jul 25 19:52:52 ray-desktop systemd[1]: Reached target Local Encrypted Volumes.
Jul 25 19:52:52 ray-desktop systemd[1]: Started Flush Journal to Persistent Storage.
Jul 25 19:52:52 ray-desktop systemd[1]: Activated swap /swapfile.
Jul 25 19:52:52 ray-desktop systemd[1]: Reached target Swap.
Jul 25 19:52:52 ray-desktop mtp-probe: checking bus 1, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.3"
Jul 25 19:52:52 ray-desktop mtp-probe: bus: 1, device: 7 was not an MTP device
Jul 25 19:52:52 ray-desktop mtp-probe: checking bus 1, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.2"
Jul 25 19:52:52 ray-desktop systemd-udevd[312]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Jul 25 19:52:52 ray-desktop mtp-probe: checking bus 1, device 3: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4"
Jul 25 19:52:52 ray-desktop mtp-probe: bus: 1, device: 3 was not an MTP device
Jul 25 19:52:52 ray-desktop mtp-probe: checking bus 1, device 4: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1"
Jul 25 19:52:52 ray-desktop mtp-probe: bus: 1, device: 4 was not an MTP device
Jul 25 19:52:52 ray-desktop mtp-probe: bus: 1, device: 6 was not an MTP device
Jul 25 19:52:52 ray-desktop systemd-udevd[304]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Jul 25 19:52:52 ray-desktop systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
Jul 25 19:52:52 ray-desktop systemd[1]: Starting Load/Save RF Kill Switch Status...
Jul 25 19:52:52 ray-desktop systemd[1]: Started Load/Save RF Kill Switch Status.
Jul 25 19:52:52 ray-desktop systemd[1]: Reached target Sound Card.
Jul 25 19:52:52 ray-desktop systemd-udevd[309]: link_config: autonegotiation is unset or enabled, the speed and duplex are not writable.
Jul 25 19:52:52 ray-desktop systemd[1]: Found device Samsung_SSD_850_EVO_500GB EFI\x20System\x20Partition.
Jul 25 19:52:52 ray-desktop systemd[1]: Started Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling.
Jul 25 19:52:52 ray-desktop systemd[1]: Reached target Local File Systems (Pre).
Jul 25 19:52:52 ray-desktop systemd[1]: Starting File System Check on /dev/disk/by-uuid/046A-4D3B...
...
Any idea what could be causing this, or what I could do to investigate?
EDIT:
It just happened again, this time without any freeze at all.
I was typing and suddenly the boot screen appeared.
The syslog shows nothing for two minutes before that:
Jul 27 22:55:01 ray-desktop CRON[6661]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 27 23:04:52 ray-desktop systemd[1]: Started Run anacron jobs.
Jul 27 23:04:52 ray-desktop anacron[6716]: Anacron 2.3 started on 2019-07-27
Jul 27 23:04:52 ray-desktop anacron[6716]: Normal exit (0 jobs run)
Jul 27 23:05:01 ray-desktop CRON[6720]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 27 23:15:01 ray-desktop CRON[6770]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 27 23:17:01 ray-desktop CRON[6784]: (root) CMD (root cd / && run-parts --report /etc/cron.hourly)
Jul 27 23:17:01 ray-desktop CRON[6785]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 27 23:17:01 ray-desktop CRON[6783]: (CRON) info (No MTA installed, discarding output)
Jul 27 23:24:57 ray-desktop gnome-software[1930]: no app for changed [email protected]
Jul 27 23:24:57 ray-desktop gnome-software[1930]: no app for changed [email protected]
Jul 27 23:24:57 ray-desktop gvfsd-metadata[1586]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
Jul 27 23:24:57 ray-desktop gvfsd-metadata[1586]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
Jul 27 23:24:57 ray-desktop gnome-shell[1518]: [AppIndicatorSupport-DEBUG] Registering StatusNotifierItem :1.81/org/ayatana/NotificationItem/software_update_available
Jul 27 23:24:57 ray-desktop gnome-shell[1518]: [AppIndicatorSupport-DEBUG] Registering StatusNotifierItem :1.81/org/ayatana/NotificationItem/livepatch
Jul 27 23:25:01 ray-desktop CRON[6846]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] microcode: microcode updated early to revision 0xb4, date = 2019-04-01
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] Linux version 4.15.0-55-generic (buildd@lcy01-amd64-029) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 (Ubuntu 4.15.0-55.60-generic 4.15.18)
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-55-generic root=UUID=a149eb1a-46b2-4403-b5e5-4cf8b2a1bbb9 ro quiet acpi_osi=!
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] KERNEL supported cpus:
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] Intel GenuineIntel
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] AMD AuthenticAMD
Jul 27 23:27:05 ray-desktop kernel: [ 0.000000] Centaur CentaurHauls
I booted the system without Linux, and eventually it mysteriously crashed too.
It's almost certainly a hardware problem, and has nothing to do with 18.04, Ubuntu, or even Linux.
(Is it appropriate to delete this question now, or to mark my own answer as the best one?)