Why a segmentation fault occurs calling a function inside setjmp()?
问题 I do not understand why in the function middleFunc() , a segmentation fault is raisen when entry_point(arg) is invoked inside the if ( setjmp(middle) ) statement. #include <stdio.h> #include <setjmp.h> jmp_buf start,middle,end; void finalFunc(void *v) { printf("hello\n"); return ; } void middleFunc(void (*entry_point)(void *), void *arg) { //just debug : this does not cause segmentation fault entry_point(arg); if ( setjmp(middle) ){ //this casues the segmentation fault entry_point(arg); /