All toilets have intregal traps built in. The bad smell may be sewer gases or sometimes from disinfecting chlorine tablets used in the toilet tank. Does the toilet flush properly? What about the tub and sink? Usually these fixtures are connected to the same vent stack.
The stack may be cracked. hate to be the bearer of bad news, but only way to tell is rip out the wall the stack is enclosed in. Are any other toilets on the same stack? u say u only smell it upstairs? A plumber can do a stack test on the vertical (dry) part of the stack by installing a test plug into the cleanout fitting and filling the stack with water from the roof. What's the age of the plumbing,and is it cast-iron?
Couldn't it just be the wax seal? When I moved into my house last year, the upstairs bathroom smelled of sewer gas. I simply unbolted the toliet and replaced the wax seal underneath. The smell disappeared. (only cost me 1.89 to fix!)
I was getting an off and on smell around one commode, today when I took off the old vinyl tile I noted that the slab was wet around the commode - and stank. I replaced the wax seal (what's yet another trip to L***'s this week?).