Cisco Systems Interview Question
368 Interview Reviews |
Back to all Cisco Systems Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Senior Software Engineer at Cisco Systems:
How would you debug Memory Corruption ?
See more for this Cisco Systems Senior Software Engineer Interview
Helpful Question?
Yes |
No
Inappropriate?



2 of 2 people found this helpful
by Boaz Sedan:
Usually the tools override malloc/free/mmap/... and change them all to mmap protected memory with guard pages before and after the user region. Trying to access beyond the bounds of the region, trying to access a freed region will immediately result in a seg-fault.
Other than that, you can always put some guard data at the beginning and end of every structure and check them occasionally in your code. In many cases you'll be able to see the corrupt data before the program crashes and in some cases you might even be able to identify what data it is (hence where it came from), e.g. strings overriding other data.