There is a weird logout issue on my MacBook Air (13", Early 2015), with macOS Sierra 10.12.4 installed. When I wake up my computer in the morning (it was neither turned off nor hibernated, but simply locked), I found that the system wanted to log out automatically. Since an application wasn't closed (that's Oracle VM VirtualBox, if it helps; an instance of VM was operating) the previous night, I saw a dialog asking whether I would continue to log out (probably in order to let me deal with the unsaved VM state). Also, I saw a file called "logout", 0KB in size, resided in the Downloads folder, which was created in the midnight.
Please help me figure out why this happens. It feels really strange. Thank you.