segmentation fault due to initialize() function when changing the size of the huge page allocation
问题 I encounter segmentation fault in my program when I play with the size of the memory that I want to allocate with huge page, i.e., when I define LENGTH = 4*1024, there is seg fault. When I define 4*1024*1024, there is no seg fault. What is the root cause of this? Code below: #define _POSIX_C_SOURCE 199309 #define _GNU_SOURCE #include <sched.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <fcntl.h> #include <time.h> #include <string.h> #include