Re: Hello, Whats a Seg fault?


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by Lil' Viv on August 16, 2001 at 02:08:12:

In Reply to: Hello, Whats a Seg fault? posted by Schmoe on August 15, 2001 at 21:21:39:

Wow, I'm surprised you hadn't encountered them this whole time . . . congrats., you must be an awesome programmer!

Anyways, it generally means you are trying to access a piece of memory that is not available.

There are a couple ways to debug it (that I know of). One is to look through your code and see where you are accessing the memory you shouldn't be, probably after the bounds of an array or something. A better way is to add "-ggdb" at the end of your g++ compile command, and then run a debugger like ddd or xxgdb . . . it will tell you where you seg. fault when you run it from the debugger.

Again, very impressed that you didn't run into seg. faults 'til now . . . I had 'em all over the place in Project 1 before I got it finished!



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]