In the Sambhava Parva of the Mahabharata Janamejaya asks, ‘What wrong did the God of justice do to be cursed by the Rishi?”
Vaisampayana said, ‘There was a Brahmana named Mandavya. The great ascetic used to sit at the entrance of his hermitage at the foot of a tree, with his arms raised and in absolute silence. And as he sat there for years together, one day a group of thieves arrived with their loot. Fearing the king’s guards who were chasing them, they hid the loot. The guards arrived there shortly and asked the Rishi, ‘Which way have the thieves taken?.’ When the Rishi maintained absolute silence, they searched the ashram and found the loot there. Suspecting the Rishi, they dragged him to the King’s court. The king sentenced him to be executed along with his supposed associates. And the officers, acting in ignorance, carried out the sentence by impaling the celebrated Rishi. And having impaled him, they went to the king with the booty they had recovered. But the virtuous Rishi, though impaled and kept without food, remained in that state for a long time without dying.
Observing his ability to live inspite of the stake, the King asked for the Rishi’s forgiveness. The Rishi was pacified by the King’s attitude. The King decided to free the Rishi. Unable to remove the stake, he cut the portion outside the body. With a portion of the stake still within him, the Rishi was known as Ani-Mandavya
Ani-Mandavya walked straight to Yama and questioned” ‘What is that sinful act committed by me unconsciously, for which I am bearing this punishment? O, tell me soon”
The god of justice, thus questioned, replied, ‘You had pierced an insect with a blade of grass and you are bearing the consequence of this act. On hearing this, Ani-Mandavya asked, “The scriptures clearly well recognize that a wrong deed committed by child less than 12 years of age is not a sin. Didn’t you know this? From today I establish that the consequence of acts committed by children below the age of fourteen shall not be sinful”.
The Rishi also cursed Yama, for his wrong judgement, to be born on earth as Vidura. No wonder Vidura had an extremely good sense of judgement and wisdom.