So I have ran into some random freezing issues, when setting up a Ryzen 1700X system for server-like (headless, unattended, ECC RAM, no OC) 24/7/365 operation. Not good at all.
I have written a small stress testing utility that can reproduce this issue quite reliably in less than 48 hours. It consists a copy of the Intel Linpack benchmark utility, that has been modified to run on AMD CPUs (just hexedited the binary and replaced some strings) and a small bash script that consists of a loop alternating between idling, single core load and 8 core load. You can download it HERE
This will stress create a very large number of transitions between idle, single core boost and all core clocks and voltages, thus stressing the reliability of power management/power saving features on the CPU and the motherboard. In my case (Asrock x370 Taichi) the test reproducibly induced a complete system lockup in less then 48h.
If you are also affected by this issue, the solution that worked for me is a UEFI setting: Advanced > AMD CBS > Zen Common Options > Power Supply Idle Control
This should be set to Typical Current Idle. The default/auto setting seems to be Low Current Idle, that saves an additional couple of watts when completely idle, but also seems to cause some sort of power glitching, that results in occasional freezes. From what I can tell, this setting disables Package C6 state, while leaving all other power saving features such as Core C6 state enabled (you may have to update your UEFI for this setting to appear, for the x370 Taichi I would recommend UEFI version 4.40, the later versions may or may not have regressions)