mūḍha-grāheṇātmano yat
pīḍayā kriyate tapaḥ
parasyotsādanārthaḿ vā
tat tāmasam udāhṛtam
mūḍha — foolish; grāheṇa — with endeavor; ātmanaḥ — of one's own self; yat — which; pīḍayā — by torture; kriyate — is performed; tapaḥ — penance; parasya — to others; utsādana- artham — for the sake of causing annihilation; vā — or; tat — that; tāmasam — in the mode of darkness; udāhṛtam — is said to be.
There are instances of foolish penance undertaken by demons like Hiranyakasipu, who performed austere penances to become immortal and kill the demigods. He prayed to Brahma for such things, but ultimately he was killed by the Supreme Personality of Godhead. To undergo penances for something which is impossible is certainly in the mode of ignorance.