Message109459
os.getcwd() causes infinite loop on solaris10 when the length of the current directory is greater than 1024 (them limit of the maximum absolute path).
os.getcwd is implemented by a while loop in python, see the function posix_getcwd in posixmodule.c. That while loop loops forever because on solaris it sets errno to ERANGE and res to NULL - even if there will be no positive results from getcwd due to the extra long path.
This infinite while cycle also causes eating up the memory.
I think the solution would be implementing a hard limit for this while loop. It could be either fixed (16k for example), or dymanic: comparing the MAXPATHLEN macro to the size of the allocated buffer and if the size of the buffer is greater than MAXLPATHLEN then raise an OSError exception with the current errno.
That bug was triggered by test_posix unittest. |
|
Date |
User |
Action |
Args |
2010-07-07 08:56:37 | csernazs | set | recipients:
+ csernazs |
2010-07-07 08:56:37 | csernazs | set | messageid: <1278492997.35.0.523630408468.issue9185@psf.upfronthosting.co.za> |
2010-07-07 08:56:35 | csernazs | link | issue9185 messages |
2010-07-07 08:56:33 | csernazs | create | |
|