You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getcwd hangs and leaks mem on Solaris <= 9 in very long file name case #51225
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=Noneclosed_at=<Date2010-07-20.18:48:26.522>created_at=<Date2009-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=<Date2010-07-20.18:48:26.520>user='https://bugs.python.org/iandekit'
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.
Activity
iandekit commentedon Sep 23, 2009
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.
BreamoreBoy commentedon Jul 20, 2010
Are there any Solaris people who could look at this? The patch file contains a very small change to posixmodule.c.
skrah commentedon Jul 20, 2010
This has just been fixed in bpo-9185.