Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#3352 closed bug (fixed)

getcwd fails python's POSIX test

Reported by: scottmc Owned by: axeld
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

This may or may not be the same as ticket #2708

~/develop/python/Lib/test> python test_posix.py
testNoArgFunctions (__main__.PosixTester) ... ok
test_access (__main__.PosixTester) ... ok
test_chdir (__main__.PosixTester) ... ok
test_chflags (__main__.PosixTester) ... ok
test_chown (__main__.PosixTester) ... ok
test_confstr (__main__.PosixTester) ... ok
test_dup (__main__.PosixTester) ... ok
test_dup2 (__main__.PosixTester) ... ok
test_fdopen (__main__.PosixTester) ... ok
test_fstat (__main__.PosixTester) ... ok
test_fstatvfs (__main__.PosixTester) ... ok
test_ftruncate (__main__.PosixTester) ... ok
test_getcwd_long_pathnames (__main__.PosixTester) ... ERROR
test_lchflags (__main__.PosixTester) ... ok
test_lsdir (__main__.PosixTester) ... ok
test_osexlock (__main__.PosixTester) ... FAIL
test_osshlock (__main__.PosixTester) ... FAIL
test_pipe (__main__.PosixTester) ... ok
test_stat (__main__.PosixTester) ... ok
test_statvfs (__main__.PosixTester) ... ok
test_strerror (__main__.PosixTester) ... ok
test_tempnam (__main__.PosixTester) ... ok
test_tmpfile (__main__.PosixTester) ... ok
test_umask (__main__.PosixTester) ... ok
test_utime (__main__.PosixTester) ... ok

======================================================================
ERROR: test_getcwd_long_pathnames (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 267, in test_getcwd_long_pathnames
    _create_and_do_getcwd(dirname)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 260, in _create_and_do_getcwd
    os.getcwd()
OSError: [Errno -2147454941] No buffer space available

======================================================================
FAIL: test_osexlock (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 108, in test_osexlock
    os.O_WRONLY|os.O_EXLOCK|os.O_NONBLOCK)
AssertionError: OSError not raised

======================================================================
FAIL: test_osshlock (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 131, in test_osshlock
    os.O_RDONLY|os.O_EXLOCK|os.O_NONBLOCK)
AssertionError: OSError not raised

----------------------------------------------------------------------
Ran 25 tests in 0.699s

FAILED (failures=2, errors=1)
Traceback (most recent call last):
  File "test_posix.py", line 278, in <module>
    test_main()
  File "test_posix.py", line 275, in test_main
    test_support.run_unittest(PosixTester)
  File "/boot/common/lib/python2.7/test/test_support.py", line 710, in run_unittest
    _run_suite(suite)
  File "/boot/common/lib/python2.7/test/test_support.py", line 693, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: errors occurred; run in verbose mode for details
~/develop/python/Lib/test> 

Change History (9)

comment:1 by axeld, 10 years ago

This is how to run the test (by scottmc on the dev list):

If you build Haiku with python added as an optional package you can run this test: cd /boot/common/lib/python2.6/test its called test_posix.py, so just run "python test_posix.py"

comment:2 by mmadia, 10 years ago

Component: - GeneralSystem/POSIX

comment:3 by axeld, 10 years ago

Resolution: fixed
Status: newclosed
Version: R1/pre-alpha1R1/Development

Fixed in hrev34276.

comment:4 by scottmc, 10 years ago

Resolution: fixed
Status: closedreopened

Tested with hrev34277 and the python test_posix.py still fails the getcwd test. I'm not sure if it was the same error message or not. This was with a python built prior to hrev34276. I'll post the output if that'd be helpful, or you can run it with the command list above.

comment:5 by scottmc, 10 years ago

Here's the error output:

Welcome to the Haiku shell.

~> ls
Desktop  config  mail
~> cd ..
/boot> cd common
/boot/common> cd lib
/boot/common/lib> cd python2.6
/boot/common/lib/python2.6> cd test
/boot/common/lib/python2.6/test> python test_posix.py
testNoArgFunctions (__main__.PosixTester) ... ok
test_access (__main__.PosixTester) ... ok
test_chdir (__main__.PosixTester) ... ok
test_chflags (__main__.PosixTester) ... ok
test_chown (__main__.PosixTester) ... ok
test_confstr (__main__.PosixTester) ... ok
test_dup (__main__.PosixTester) ... ok
test_dup2 (__main__.PosixTester) ... ok
test_fdopen (__main__.PosixTester) ... ok
test_fstat (__main__.PosixTester) ... ok
test_fstatvfs (__main__.PosixTester) ... ok
test_ftruncate (__main__.PosixTester) ... ok
test_getcwd_long_pathnames (__main__.PosixTester) ... ERROR
test_lchflags (__main__.PosixTester) ... ok
test_lsdir (__main__.PosixTester) ... ok
test_osexlock (__main__.PosixTester) ... FAIL
test_osshlock (__main__.PosixTester) ... FAIL
test_pipe (__main__.PosixTester) ... ok
test_stat (__main__.PosixTester) ... ok
test_statvfs (__main__.PosixTester) ... ok
test_strerror (__main__.PosixTester) ... ok
test_tempnam (__main__.PosixTester) ... ok
test_tmpfile (__main__.PosixTester) ... ok
test_umask (__main__.PosixTester) ... ok
test_utime (__main__.PosixTester) ... ok

======================================================================
ERROR: test_getcwd_long_pathnames (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 267, in test_getcwd_long_pathnames
    _create_and_do_getcwd(dirname)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 262, in _create_and_do_getcwd
    _create_and_do_getcwd(dirname, current_path_length + len(dirname) + 1)
  File "test_posix.py", line 260, in _create_and_do_getcwd
    os.getcwd()
OSError: [Errno -2147454941] No buffer space available

======================================================================
FAIL: test_osexlock (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 108, in test_osexlock
    os.O_WRONLY|os.O_EXLOCK|os.O_NONBLOCK)
AssertionError: OSError not raised

======================================================================
FAIL: test_osshlock (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 131, in test_osshlock
    os.O_RDONLY|os.O_EXLOCK|os.O_NONBLOCK)
AssertionError: OSError not raised

----------------------------------------------------------------------
Ran 25 tests in 0.520s

FAILED (failures=2, errors=1)
Traceback (most recent call last):
  File "test_posix.py", line 278, in <module>
    test_main()
  File "test_posix.py", line 275, in test_main
    test_support.run_unittest(PosixTester)
  File "/boot/common/lib/python2.6/test/test_support.py", line 724, in run_unittest
    _run_suite(suite)
  File "/boot/common/lib/python2.6/test/test_support.py", line 707, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: errors occurred; run in verbose mode for details
/boot/common/lib/python2.6/test> 

comment:6 by axeld, 10 years ago

You cannot have tested with hrev34277, as the kernel will never return "No buffer space available" anymore. Please confirm.

comment:7 by axeld, 10 years ago

BTW I did run the python test before closing this ticket, and it does not fail anymore here.

comment:8 by scottmc, 10 years ago

Resolution: fixed
Status: reopenedclosed

Oh. I had tested with the new python build but that was "just" before I had applied the hrev34277 commit. So that explains why the results were different. Here's the new test results to show that yes the getcwd is fixed:

/boot/common/lib/python2.6/test> python test_posix.py
testNoArgFunctions (__main__.PosixTester) ... ok
test_access (__main__.PosixTester) ... ok
test_chdir (__main__.PosixTester) ... ok
test_chflags (__main__.PosixTester) ... ok
test_chown (__main__.PosixTester) ... ok
test_confstr (__main__.PosixTester) ... ok
test_dup (__main__.PosixTester) ... ok
test_dup2 (__main__.PosixTester) ... ok
test_fdopen (__main__.PosixTester) ... ok
test_fstat (__main__.PosixTester) ... ok
test_fstatvfs (__main__.PosixTester) ... ok
test_ftruncate (__main__.PosixTester) ... ok
test_getcwd_long_pathnames (__main__.PosixTester) ... ok
test_lchflags (__main__.PosixTester) ... ok
test_lsdir (__main__.PosixTester) ... ok
test_osexlock (__main__.PosixTester) ... FAIL
test_osshlock (__main__.PosixTester) ... FAIL
test_pipe (__main__.PosixTester) ... ok
test_stat (__main__.PosixTester) ... ok
test_statvfs (__main__.PosixTester) ... ok
test_strerror (__main__.PosixTester) ... ok
test_tempnam (__main__.PosixTester) ... ok
test_tmpfile (__main__.PosixTester) ... ok
test_umask (__main__.PosixTester) ... ok
test_utime (__main__.PosixTester) ... ok

======================================================================
FAIL: test_osexlock (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 108, in test_osexlock
    os.O_WRONLY|os.O_EXLOCK|os.O_NONBLOCK)
AssertionError: OSError not raised

======================================================================
FAIL: test_osshlock (__main__.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_posix.py", line 131, in test_osshlock
    os.O_RDONLY|os.O_EXLOCK|os.O_NONBLOCK)
AssertionError: OSError not raised

----------------------------------------------------------------------
Ran 25 tests in 0.422s

FAILED (failures=2)
Traceback (most recent call last):
  File "test_posix.py", line 278, in <module>
    test_main()
  File "test_posix.py", line 275, in test_main
    test_support.run_unittest(PosixTester)
  File "/boot/common/lib/python2.6/test/test_support.py", line 724, in run_unittest
    _run_suite(suite)
  File "/boot/common/lib/python2.6/test/test_support.py", line 707, in _run_suite
    raise TestFailed(err)
test.test_support.TestFailed: errors occurred; run in verbose mode for details
/boot/common/lib/python2.6/test> 

Sorry for the noise. I'll rerun the test in verbose mode to update the status on the two remaining failures in the pytohn posix test, but this ticket is indeed fixed.

comment:9 by axeld, 10 years ago

No problem. I recently removed O_EXLOCK, and O_SHLOCK, since we probably won't ever support them anyway, so that might need another Python update, too.

Note: See TracTickets for help on using tickets.