add test for portability (kahansei_kojo in dev_V)
This commit is contained in:
21
test/portability/unhandled_page_fault.c
Normal file
21
test/portability/unhandled_page_fault.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
#define ARRAY_SIZE 10
|
||||
|
||||
void handler(int sig) {
|
||||
printf("[OK] unhandled_page_fault_01: received SIGSEGV\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char** argv){
|
||||
int* test = NULL;
|
||||
|
||||
signal(SIGSEGV, handler);
|
||||
printf("try to access out of range!\n");
|
||||
*test = 99;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user