This question already has an answer here:
I had always assumed that human waste was removed from commercial aircraft while they were on the ground, some inscrutable machine coming by to suck the material out and carry it away.
Although that may happen, it appears that planes do have the ability to poop and they use that ability as one woman found out yesterday after a plane pooped on her house.
Apparently commercial carriers euphemistically call the poop "blue ice".
Under what circumstances do planes eject blue ice while airborne rather than dispose of it when on the ground?
Note that the alleged duplicate question does not answer the question correctly so I have posted a correct answer here below.