-
Segmentation Fault
Hi!
What are the reasons for a segmentation fault?
My program doesn't always cause a segmentation fault, only sometimes although the program flow is exactly the same. Do you have any ideas?
I'm using RedHat Linux and KDevelop.
Thanks and best regards
Haos
-
When you try to access memory that you're not supposed to, you get a segmentation violation. Typically this can happen when you're working with arrays and pointers.
-
>My program doesn't always cause a segmentation fault, only sometimes although the
>program flow is exactly the same. Do you have any ideas?
Some times you get lucky and some times you don't.
>What are the reasons for a segmentation fault?
Accessing memory outside of your address space is the #1 reason. Make sure you aren't writing somewhere that you shouldn't be first thing.