Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semaphore errors on AIX 7.1 #56581

Closed
reshmigeorge mannequin opened this issue Jun 20, 2011 · 11 comments
Closed

semaphore errors on AIX 7.1 #56581

reshmigeorge mannequin opened this issue Jun 20, 2011 · 11 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@reshmigeorge
Copy link
Mannequin

reshmigeorge mannequin commented Jun 20, 2011

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:

    assignee = None
    closed_at = <Date 2011-07-21.18:01:45.378>
    created_at = <Date 2011-06-20.08:56:08.348>
    labels = ['type-bug']
    title = 'semaphore errors on AIX 7.1'
    updated_at = <Date 2011-07-21.18:01:45.377>
    user = 'https://bugs.python.org/reshmigeorge'

    bugs.python.org fields:

    activity = <Date 2011-07-21.18:01:45.377>
    actor = 'neologix'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-07-21.18:01:45.378>
    closer = 'neologix'
    components = []
    creation = <Date 2011-06-20.08:56:08.348>
    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']

    @reshmigeorge
    Copy link
    Mannequin Author

    reshmigeorge mannequin commented Jun 20, 2011

    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.

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jun 23, 2011

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

    @vstinner
    Copy link
    Member

    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 ;-)

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jun 24, 2011

    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...

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jul 18, 2011

    So, what do we do now?

    @sable
    Copy link
    Mannequin

    sable mannequin commented Jul 19, 2011

    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
    Copy link
    Member

    pitrou commented Jul 19, 2011

    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!

    @pitrou pitrou added the type-bug An unexpected behavior, bug, or error label Jul 19, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 21, 2011

    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

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 21, 2011

    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

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 21, 2011

    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

    @neologix
    Copy link
    Mannequin

    neologix mannequin commented Jul 21, 2011

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

    @neologix neologix mannequin closed this as completed Jul 21, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants