What exactly is a segmentation fault (runtime error SIGSEGV)? Can someone tell me pls?
created
last reply
- 1
reply
- 243
views
- 2
users
What exactly is a segmentation fault (runtime error SIGSEGV)? Can someone tell me pls?
From glibc documentation:
[i]This signal is generated when a program tries to read or write
outside the memory that is allocated for it, or to write memory
that can only be read. (Actually, the signals only occur when the
program goes far enough outside to be detected by the system's
memory protection mechanism.) The name is an abbreviation for
"segmentation violation".
Common ways of getting a SIGSEGV' condition include dereferencing
SIGSEGV' or`SIGBUS'.[/i]
a null or uninitialized pointer, or when you use a pointer to step
through an array, but fail to check for the end of the array. It
varies among systems whether dereferencing a null pointer generates