Skip to content

getcwd hangs and leaks mem on Solaris <= 9 in very long file name case #51225

Closed

Description

@iandekit
mannequin
BPO 6976
Nosy @skrah
Superseder
  • bpo-9185: os.getcwd causes infinite loop on solaris
  • Files
  • EKIT.PATCH5: avoid getwcd hang
  • 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 2010-07-20.18:48:26.522>
    created_at = <Date 2009-09-23.05:55:36.880>
    labels = ['build', 'performance']
    title = 'getcwd hangs and leaks mem on Solaris <= 9 in very long file name case'
    updated_at = <Date 2010-07-20.18:48:26.520>
    user = 'https://bugs.python.org/iandekit'

    bugs.python.org fields:

    activity = <Date 2010-07-20.18:48:26.520>
    actor = 'skrah'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-07-20.18:48:26.522>
    closer = 'skrah'
    components = ['Build']
    creation = <Date 2009-09-23.05:55:36.880>
    creator = 'iandekit'
    dependencies = []
    files = ['14955']
    hgrepos = []
    issue_num = 6976
    keywords = []
    message_count = 3.0
    messages = ['93028', '110925', '110945']
    nosy_count = 3.0
    nosy_names = ['skrah', 'iandekit', 'BreamoreBoy']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '9185'
    type = 'resource usage'
    url = 'https://bugs.python.org/issue6976'
    versions = ['Python 2.6']

    Activity

    1. iandekit commented on Sep 23, 2009

      iandekitmannequin
      MannequinAuthor

      test_posix hung on Solaris 9 ... traced to getcwd test hanging.

      This in turn was traced to the very long filename case...
      It seems posixmodule was modified (since py2.4.3 at least)
      to retry getcwd with a bigger buffer if ERANGE occurs.

      However on Solaris 9 its not documented that ERANGE also
      occurs if getcwd(3) can't cope with the path length, even
      if the buffer is big enough. This causes posix_getcwd() to
      loop malloc'ing a bigger buffer, forever.

      I enclose a patch that limits the damage, to 1Mbyte at least.
      (not sure if more recent Solaris 9 patches than we have
      provide another solution)

      On Solaris 10, there is no problem as the getcwd() is implemented
      as a system call.

    2. added
      buildThe build process and cross-build
      performancePerformance or resource usage
      on Sep 23, 2009
    3. BreamoreBoy commented on Jul 20, 2010

      BreamoreBoymannequin
      Mannequin

      Are there any Solaris people who could look at this? The patch file contains a very small change to posixmodule.c.

    4. skrah commented on Jul 20, 2010

      skrahmannequin
      Mannequin

      This has just been fixed in bpo-9185.

    5. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      buildThe build process and cross-buildperformancePerformance or resource usage

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions