On Thu Mar 13 17:38:03 2008, ANDK wrote:
Show quoted text> My smoke box ran out of semaphores these days. I cleaned out all
> cumulated semaphores and ran make test on IPC::Mmap. After that again 5
> occupied semaphores were around. Repeat. Same thing. So I'd say the
> tests are leaking semaphors, are they not?
>
> Greetings && Thanks,
Better 3 years late than never I guess. I will be doing some maintenance
on the package, let's see what we can get fixed.
I have noticed that the code requesting the new semaphore was using
IPC_PRIVATE, which basically means leak every time the library is used.
So I replaced the offending portion with a piece of code that uses ftok
to get a unique semaphore id that remains the same. The ftok refers to
the file specified in the mmap call. The side effect is that when using
anonymous, you can no longer specify a dummy file, but I don't see any
problem with that.
Long story short, in my tests the leak stopped. Only one semaphore will
be consumed no matter how many times a program gets run.
I'll close the ticket at this point, but please feel free to reopen or
contact me directly if there's anything.
Best Regards,
Athanasios Douitsis