Sometimes box enters reboot cycle when video stopped

I have Coreelec 9.2.0 installed on a Mini M8S II box (S905X CPU).
The box worked as expected with the same configuration for a long
time (last time the configuration changed during upgrade to 9.2.0,
which happened around a time when the version was released).

Lately (in recent days), a strange problem started to occur: sometimes
you play a video from a local drive (540p in this case), then press
‘back’ button on a remote (so that UI appears and the video continues
to play in the background) and then stop the video (pressing a button
which is mapped accordingly on a remote). Then coreelec enters a reboot
loop, and keeps trying to reboot many times, until eventually it succeeds
to complete the boot, and then things work as usually until the problem
occurs again. The reboots can continue from a minute to 5 minutes.

The box is connected with HDMI to a 4k TV (Sony Bravia KD-55XF7096), and
each reboot cycle looks like a usual reboot, with the difference that
at the end of a cycle instead of kodi’s gui appearing, the cycle starts

Here is a description of a boot cycle:

  1. For a split second you see that display switches to full hd (1024P)
    mode, and see a notification that no signal was detected

  2. Display switches to full resolution (3840x2160) and for a couple of
    seconds you see logo from Android’s boot screen (which is installed on
    internal storage, while coreelec is installed on sdcard)

  3. For about 5 seconds coreelect logo appears over the whole display,
    and then version number in the upper left corner

  4. The coreelect logo minimizes to the upper-left corner (taking up a
    quarter of a screen instead of a whole screen), then it disappears
    completely and display resolution switches for a second to 3840x2160,
    then to 1024P

On a normal boot on that stage kodi UI appears, but in a boot loop
the whole cycle repeats.

I cannot reproduce the problem intentionally by playing/stopping video
as described. Also, when the box is rebooted manually it never goes
into a reboot cycle.

What can cause such a problem, and how it can be debugged/solved?

Now after a lot of time I can finally answer my own question - maybe the solution will be useful to somebody else as well.

The problem occurred due to a bad power cable - somewhere inside the cable there was a loose contact, so from time to time due to external impacts (wind maybe), the power was recycled, causing reboots. I found out about it quite accidentally, since usually moving the cable by hand didn’t cause the loose contact to cause problem.

After I replaced the cable, the problem disappeared completely, and for the first time I got more than 30 days uptime.