Mostly its due to a software bug, or a software process trying to access some areas of memory which it doesnt have right to..etc. Most cases its due to a programming error which causes either the router to crash or reboot. There are many Field notice documents from Cisco about various buffer overflow errors. Depending upon what router you have and the problem you are facing, if its a known bug/problem there should be a match on the Cisco website. Otherwise you will mostly have to contact Cisco TAC.
Search on www.cisco.com with "Buffer Overflow" as the search string. You should get a bunch of them.
Good luck!
Sankar Nair
UC Solutions Architect
Pacific Northwest | CDW
CCIE Collaboration #17135 Emeritus