Why is this segfaulting? Can someone explain the valgrind error?

Valgrind says that the illegal write is occurring at Address 0x6172676f72502074.

If you look at that address as ASCII characters, it’s: argorP t, or converting from little endian: t Progra.

This looks like part of one of your menu items, “9. Abort Program”. Maybe the bug is that menu_init() is writing past the end of the menu_items[] array?

I’d guess that stepping through your program in a debugger should find the problem quick enough.

Leave a Comment