Python script produces "sem_trywait: Permission denied"

Neal Norwitz nnorwitz at
Wed Oct 19 06:33:36 CEST 2005

Mark E. Hamilton wrote:
> Sorry, I probably should have re-stated the problem:
> We're using Python 2.3.5 on AIX 5.2, and get the follow error messages
> from some of our code. I haven't yet tracked down exactly where it's
> coming from:
> sem_trywait: Permission denied
> sem_wait: Permission denied
> sem_post: Permission denied

I'm I would be very concerned about these.  Permission denied is
somewhat baffling to me.  man sem_wait on Linux doesn't show EPERM as a
possible error condition.

The code that likely generates these messages is in
Python/thread_pthread.h near line  319.

Do you have lots of threads?  Do you make heavy use of semaphores?
Maybe they are running out or something.  Do you know if your locking
is really working?

> We don't run these scripts as root, so I can't say whether they work as
> root. I suspect they would, though, since root has permissions to do
> anything.

I'm not sure.  I don't know what the Permission denied really means.

I wonder if there some weird compiler optimization thing going on.  Not
that I'm blaming the compiler, it could well be a python problem.  I
just don't know.

Do you have any memory debugging tools that you can run python under to
see if there's something weird python is doing?  Valgrind should work
on PPC now, but you may need to apply a patch, I'm not sure PPC support
is mainline in v3.  Other possibilities include purify if that works on
AIX or sentinel.


More information about the Python-list mailing list