我的进程正在访问已创建的共享内存。附加到共享内存的指针是一个包含一个指针和 2 或 3 个变量的结构。
例如:
typedef struct _info_t{
int id;
char c;
}info_t;
typedef struct _details_t{
int buff_id;
info_t* info;
}details_t;
details_t* details = shmat(shmid,(void*)0,0);
printf("\n %d \n",details->info->id); // gives me a segmentation fault