python / cpython

The Python programming language
https://www.python.org
Other
62.47k stars 29.99k forks source link

semaphore errors on AIX 7.1 #56581

Closed 7a6fb546-01fd-40de-a667-0e1a0ce6e6a9 closed 13 years ago

7a6fb546-01fd-40de-a667-0e1a0ce6e6a9 commented 13 years ago
BPO 12372
Nosy @pitrou, @vstinner
Files
  • aix_broken_sem.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = created_at = labels = ['type-bug'] title = 'semaphore errors on AIX 7.1' updated_at = user = 'https://bugs.python.org/reshmigeorge' ``` bugs.python.org fields: ```python activity = actor = 'neologix' assignee = 'none' closed = True closed_date = closer = 'neologix' components = [] creation = creator = 'reshmi.george' dependencies = [] files = ['22428'] hgrepos = [] issue_num = 12372 keywords = ['patch', 'needs review'] message_count = 11.0 messages = ['138693', '138871', '138873', '138962', '140606', '140653', '140706', '140820', '140821', '140822', '140823'] nosy_count = 6.0 nosy_names = ['pitrou', 'vstinner', 'sable', 'neologix', 'python-dev', 'reshmi.george'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue12372' versions = ['Python 2.7', 'Python 3.2', 'Python 3.3'] ```

    7a6fb546-01fd-40de-a667-0e1a0ce6e6a9 commented 13 years ago

    The same problem that was reported in bpo-9700 is appearing on AIX 7.1. The following message has been seen when running multi-process python program: sem_trywait: Permission denied sem_post: Permission denied sem_wait: Permission denied sem_post: Permission denied

    It can be easily corrected by defining HAVE_BROKEN_POSIX_SEMAPHORES for AIX 7, like it is done for AIX 6.

    79528080-9d85-4d18-8a2a-8b1f07640dd7 commented 13 years ago

    Patch attached. I've used a wildcard so that it won't break when AIX 8 goes out (and it's POSIX).

    vstinner commented 13 years ago

    It is the fourth issue for the same problem, other issues:

    The initial issue was related to semaphores and fork() (msg60639). Pass pshared=1 to sem_init() gets around this issue, but introduce new issues (msg60640). In general, locks and fork don't work together: there are still such issues in Python, see for example the issue bpo-6721.

    It looks like the behaviour of the semaphore depends on the underlying file system: see msg56228.

    Nobody is able to get more information, or maybe nobody wants to dig this issue. It would be better to get the real cause of the issue, and maybe report the issue to the editor of AIX. I don't have access to this AIX, and only few Python developers have access to this OS.

    At least, I would like to know if Sébastien Sablé (the author of the original patch) changed his opinion about this issue since 2007 ;-)

    79528080-9d85-4d18-8a2a-8b1f07640dd7 commented 13 years ago

    Nobody is able to get more information, or maybe nobody wants to dig this issue. It would be better to get the real cause of the issue,

    Well, it looks like a libc or kernel bug, and we probably can't do much about it. Just falling back to mutex + condition variable instead of POSIX semaphores does the trick, so I'll say just avoid POSIX semaphores altogether on AIX and we should be fine. People could report this to their AIX vendor, but they should definitely consider dropping this terminally broken platform and switch to, let's says, Linux or BSD...

    79528080-9d85-4d18-8a2a-8b1f07640dd7 commented 13 years ago

    So, what do we do now?

    cf2aeb3c-f43f-407a-8d37-30a2b5033222 commented 13 years ago

    Hi,

    sorry for the late reply.

    > STINNER Victor added the comment: >

    At least, I would like to know if Sébastien Sablé (the author of the original patch) changed his opinion about this issue since 2007 ;-)

    I haven't changed my mind concerning this patch and we still use it for the Python that we deploy on AIX 5.3 and AIX 6.1 systems (I don't use AIX 7 yet).

    Not using this patch will result in performance degradation and "sem_post: Permission denied" error messages from the system popping on the console.

    > Charles-François Natali added the comment: > > Well, it looks like a libc or kernel bug, and we probably can't do > much about it. Just falling back to mutex + condition variable instead > of POSIX semaphores does the trick, so I'll say just avoid POSIX > semaphores altogether on AIX and we should be fine. People could > report this to their AIX vendor, but they should definitely consider > dropping this terminally broken platform and switch to, let's says, > Linux or BSD...

    I agree with Charles-François that it is an AIX bug that should be reported to IBM so that they could fix it in a future release. I already submitted some "tickets" to IBM concerning other problems and it is not exactly an "agile" company so you have to be very patient.

    I also agree that people should consider dropping this broken platform, but unfortunately IBM is aggressively and successfully (AFAIK) pushing this platform to many customers (in the finance industry in particular) so I don't expect it to die soon.

    regards

    pitrou commented 13 years ago

    The patch looks fine to me.

    in the finance industry in particular

    Ha, I've seen that. There are even proprietary desktop applications for AIX!

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 13 years ago

    New changeset f5a7d413638d by Charles-François Natali in branch '2.7': Issue bpo-12372: POSIX semaphores are broken on AIX: don't use them. http://hg.python.org/cpython/rev/f5a7d413638d

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 13 years ago

    New changeset f0475f78d45c by Charles-François Natali in branch '3.2': Issue bpo-12372: POSIX semaphores are broken on AIX: don't use them. http://hg.python.org/cpython/rev/f0475f78d45c

    1762cc99-3127-4a62-9baf-30c3d0f51ef7 commented 13 years ago

    New changeset 44a02d6b74e4 by Charles-François Natali in branch 'default': Merge - Issue bpo-12372: POSIX semaphores are broken on AIX: don't use them. http://hg.python.org/cpython/rev/44a02d6b74e4

    79528080-9d85-4d18-8a2a-8b1f07640dd7 commented 13 years ago

    Patch committed: this should fix POSIX semaphores failures on AIX. Reshmi, thanks for reporting this!