- a SEGV is caused when you access memory you're not meant to (e.g., outside of your address space).
bus_segv.c:
#include
char array[10];
int main(int argc, char *argv[]) {
return array[atol(argv[1])];
}
$ ./bus_segv -4129
Segmentation fault: 11
$ ./bus_segv 28639
Bus error: 10
$ ./bus_segv 53215
Bus error: 10
No comments:
Post a Comment