Most of the answers are half answers, yes you probably have a dry trap, caused by a blocked vent.
When water goes down a pipe it creates a siphon until the water drains down to a level pipe, then gases leak up the pipe. To prevent gas entering the room they put a trap, a U or S shaped pipe to "trap" enough water to block the flow of gas. But for water to stay in the pipe you have to break the siphon effect, so they strategically tap the pipe where it turns down the wall with an upward vertical pipe to allow air into the pipe to break the siphon. Normally you would think a vent lets the bad smell out, but in this case it lets air into the pipe. After water has drained from the vertical pipe it will vent gas above the roof, but that's not a problem.
It could also be a bad wax ring, but that normally doesn't just randomly happen, or the vent pipe is broken or somehow improperly installed and the gas that is suppose to vent above the roof is getting drawn back into the house.