JohnAnthony / TROG

ncurses roguelike done right.
Other
22 stars 3 forks source link

Segfault from equipping #9

Closed notwa closed 12 years ago

notwa commented 12 years ago

Unequipped a Greataxe after failing to equip a Heavy Shield, then attempted to equip the Heavy Shield again. Segfault. Tried it again, but this time with a Greatsword and a Torch. Segfault. I suppose this means it's related to two-handed equipment.

Also, I'd appreciate it if you pointed me in the right direction so that I may provide some dirtier details for debugging other people's programs.

JohnAnthony commented 12 years ago

gdb is great for this. Just run

"gdb trog"

And then enter "run" (or the shorthand "r") into the prompt to run the game. When you get a segfault you can use "backtrace" (shorthand "ba") to see the current state of the stack. You can use "info locals" (short "i lo") to view local variables and move up and down the stack with "up" and "down".

I'll take a look at the issue now. GDB is a great tool and ^ that should be enough to get you started figuring out where segfaults are caused.

JohnAnthony commented 12 years ago

Issue's fixed. Here's how if you're interested.

http://ompldr.org/vZGk1MA

notwa commented 12 years ago

For shits and giggles, this was the last line on my terminal when it segfaulted:

Segmentation faultt of Lesser Rejuvenation

Anyway, thanks, I'll look more into gdb.

JohnAnthony commented 12 years ago

This book is excellent. PDFs are about.

http://www.amazon.co.uk/The-Art-Debugging-Eclipse-Professionals/dp/1593271743

I grabbed a PDF a while back and liked enough to buy the book.