#include #include /** * * This binary receives 2 numbers, an L and an R * * It will intentionally hit Segmentation Fault(actually SIGSEGV) whenever 30 is in the interval [L,R] * * It will be used to test the binary search segfault finder * */ int main(int argc, int **argv) { char exists; char *Q[3000]; int i; int L = atoi((char*)argv[1]); int R = atoi((char*)argv[2]); printf("L=%d R=%d",L,R); /*exit(0);*/ for(i=0;i<3000;i++) Q[i] = &exists; Q[30] = NULL; // <==== I want to cause a SIGSEGV through this ! for(i=L;i<=R;i++) { int T = *Q[i]; // <== will segfault when i == 30 because I said so :) }; };