Re: sem_open() returns ENOSPC
Re: sem_open() returns ENOSPC
- Subject: Re: sem_open() returns ENOSPC
- From: Alastair Houghton <email@hidden>
- Date: Wed, 14 Jul 2010 23:33:19 +0100
On 14 Jul 2010, at 22:49, Mo McRoberts wrote:
> On 14-Jul-2010, at 22:44, Norm Green wrote:
>
>> Hi,
>>
>> We have a problem where sem_open() returns ENOSPC. This occurs during program startup and repeats until we reboot the machine. Then it goes away for awhile but eventually returns until we reboot the machine again. Is there a better solution than restarting the machine?
>
> I'm guessing you've already run 'ipcs' when this problem occurs, and it's not listing lots of semaphores?
ipcs only lists SysV semaphores, whereas the OP is using POSIX semaphores (so it won't help). I'm not sure that there is any equivalent for POSIX semaphores (which is a bit of a shame, actually).
Anyway, I agree with your implied diagnosis; the kernel will return ENOSPC if you allocate more than posix_sem_max (default 10,000, configurable via sysctl as kern.posix.sem.max) semaphores. Most likely the OP is leaking semaphores somehow (possibly some sem_close() and sem_unlink() calls are needed somewhere?)
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden