I move my laptop between places in my flat quite a bit for this I've got multiple power adaptors connected to outlets in two rooms. Now every now and again (I can't see a pattern) when I move the laptop between the two rooms with the adaptors or if I have been using the computer for a while on battery when I connect the power cable Ubuntu locks up (typically sound gets stuck in a 1-2 loop, no key or mouse response). The only thing I can do in this situation is force a shutdown by holding the power button.
Since I don't know enough about how the logs work to figure out if a hard reset kills all important information or where I could find any clues to why the laptop locks up when reconnecting power. Is there a way for me to find out what happened in the moment of switching to AC power that causes the system to freeze?