Lagging and freezing on Logout

I have noticed that after pressing logout, sometimes nothing happens for 2+ minutes (just had to force a restart on my laptop). The window borders disappear and the theme becomes the barebones generic one. Not sure if this has anything to do with it, but I do use compiz (compiz reloaded).

You might want to check some of the animations with compiz, I find using them can cause lagging and slowness

Maybe turn a few off if not needed

This very rarely happens to me too, but on 16.04 (under normal Compiz).

When it happens, I assume there is a process hanging and is blocking logout/shutdown until it is killed.

Unfortunately I already have all the animations disabled on Compiz.

I also encountered it on 16.04, but less frequently.

Edit: I thought it might be VirtualBox, but after restarting and logging out, that’s not the problem. Mine tends to just freeze completely when pressing logout now.

Any logs I can provide that would be helpful?