When you shift the car out of Park the doors automatically lock. There is a sensor in your shifter assembly which detects when the shifter has moved out of Park and then this locks your doors. When the sensor goes bad it trips the door locks at random intervals.
Most dealerships will replace the entire shifter assembly as it is difficult to replace just the sensor.
I replaced my shifter assembly myself. It isn't that difficult and took about an hour. You can contact a local dealership and purchase a shifter assembly from them; Autozone and other aftermarket auto parts dealers will not have this part.
Does all your door look buttens work in the car. I just had the same issue but I noticed lock/unlock button on the driver side door panel was no longer working. I poped off the door panel and disconnected the power to the door lock switch. No more popin locks. The down side is, Now the only ways I can unlock my door is with keyless entry or the passenger unlock/lock buttens. Although im sure I just replaced the door lock switch with one from a junk yard I could fix everything.
Try isolating each door lock separately...you may find that one of the solenoids is bad causing the problem.You can do so by going to each door and and seeing if anyone of the locks acts differently, and them unplug that one and see if the problem stops. If it does, you found the problem, now you have to decide whether you want to fix it or leave it unplugged.
This also happened to my 05 cobalt...I am the original owner and had never experienced anything like it before...I simply took the fuse out that controlled the power locks...and that seemed to work...only thing that stinks is I can't lock my doors with my keyless entry...but it does engage the alarm still..so its all good!
I had the problem fixed at the dealer. $80 for scan which diagnosed a switch in the arm rest which I suspect had gotten wet when I left the window cracked in the rain and $60 for labor. I've been having the problem again. If I remove the fuse the alarm goes wild when I use the key to open the doors or trunk..GM didn't give me anyway to disable the alarm.The car is too old to be worth spending for a minor convenience.I sprayed WD 40 into both switches stopped using the power lock. so far so good.
guess what simple water on switch i threw a cup at the window trying to through it out and it splashed on the switch and a few days later it did that and i took the toggle apart and cleaned off the corrosion and bam it was salved