Stink bugs get their name from the unpleasant odor they produce when they are threatened. It is thought that this odor helps protect the bugs against predators. The stink bugs produce the smelly chemical in a gland on their abdomen. Some species can actually spray the chemical several inches. The smell has often been compared to strong herbs and spices like cilantro and coriander.
Interestingly, the composition of the odor is comprised of chemicals commonly used as food additives and is present in cilantro. This smell can linger for hours so, if possible, try to avoid stink bugs or carefully sweep or vacuum them up if they have entered your house.