Drivers found themselves stranded on routes in Hampshire, including the M3 and had to leave their cars overnight.