I have now ran into this problem twice. When Windows starts automatic maintenance the computer becomes non-responsive and eventually freezes.
And both times I was able to backtrack the problem to editing registry. Undoing the changes in registry fixed the problem and maintenance was able to complete without any trouble.
First time was with CCleaner. I ran normal cleanup including cleaning suggested entries from registry. Afterwards I had to restore registry backups, and problem disappeared.
Second time was when I wanted to test some very outdated software which installed didn't work anymore in Win8. I had to run the file including the registry entries manually. Had the software working, but later on removed it because of the maintenance freeze. And again undoing the edit the freeze trouble disappeared.
Now the question is why and how this happens?
Is there some sort of backlog for registry edits, and when OS can't figure out who/what did the edit it just freezes? And is it anyway possible for user to edit registry without causing problems like this?
EDIT: OS was originally Windows xp, upgraded to Windows 7, and later on upgraded to Windows 8 and 8.1