Mahānāma, the Sākiyan, visits the Buddha at Nigrodhārāma and asks him why it is that evil states of mind arise in one. The Buddha replies that it is because of certain undiscarded states of consciousness, which can be got rid of through renunciation.
He proceeds to describe how he, too, failed to find satisfaction before his Enlightenment. He then tells of a conversation he once had on Gijjhakūta with some Niganthas, who believed that suffering could be got rid of through austerities and how he told them of his happiness which was far greater even than that of Bimbisāra, king of Magadha. M.i.91ff