EINVAL A new segment was to be created and size < SHMMIN or size > SHMMAX, or no new segment was to be created, a segment with given key existed, but size is greater than the size of that segment.
You should check whether you still have an segment for this key using ipcs and remove it with ipcrm.
ipcs -m 查看共享内存
ipcs -p 查看共享内存的所有进程ID
ipcrm -m shmid 删除共享内存ID
来源:CSDN
作者:Mrknowledge
链接:https://blog.csdn.net/Mrknowledge/article/details/104295104