semget() is failing because the system is out of semaphores. Look at the documentation of semsys:seminfo_semmni and semsys:seminfo_semmns