classification
Title: test_os extended attribute setxattr tests can fail with ENOSPC (Errno 28)
Type: Stage: resolved
Components: Tests Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Hibou57, ned.deily, r.david.murray, vstinner
Priority: normal Keywords: easy

Created on 2014-07-19 16:10 by Hibou57, last changed 2019-07-29 11:32 by vstinner. This issue is now closed.

Files
File name Uploaded Description Edit
test-logs.tar.gz Hibou57, 2014-07-19 16:10 contains stderr-test.txt and stdout-test.txt
Messages (5)
msg223468 - (view) Author: Yannick Duchêne (Hibou57) Date: 2014-07-19 16:10
`make test` fails with Python 3.4.1 on Ubuntu 12.04 Intel 32 bits.

The single `./configure` option used, was `--prefix=$HOME/.local`.

As attached file, an archive containing both standard output and standard error outputs.

Not some important error notifications appears only in standard output, not in standard error: “OSError: [Errno 28] No space left on device”.

The latter is surprising as there was 11GiB free space.
msg223497 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-07-20 03:16
(In the future, please just show the test failures and their tracebacks rather than uploading a tar file.) 

The logs show three test failures in test_os:
======================================================================
ERROR: test_fds (test.test_os.ExtendedAttributeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2238, in test_fds
    self._check_xattrs(getxattr, setxattr, removexattr, listxattr)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2213, in _check_xattrs
    self._check_xattrs_str(str, *args, **kwargs)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2202, in _check_xattrs_str
    setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2231, in setxattr
    os.setxattr(fp.fileno(), *args)
OSError: [Errno 28] No space left on device: 4

======================================================================
ERROR: test_lpath (test.test_os.ExtendedAttributeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2223, in test_lpath
    os.listxattr, follow_symlinks=False)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2213, in _check_xattrs
    self._check_xattrs_str(str, *args, **kwargs)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2202, in _check_xattrs_str
    setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
OSError: [Errno 28] No space left on device: '@test_16527_tmp'

======================================================================
ERROR: test_simple (test.test_os.ExtendedAttributeTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2219, in test_simple
    os.listxattr)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2213, in _check_xattrs
    self._check_xattrs_str(str, *args, **kwargs)
  File "/home/yannick/c/src/Python-3.4.1/Lib/test/test_os.py", line 2202, in _check_xattrs_str
    setxattr(fn, s("user.test"), b"a"*1024, **kwargs)
OSError: [Errno 28] No space left on device: '@test_16527_tmp'

----------------------------------------------------------------------

Note that all three failures are on attempts to set a 1024-byte extended attributes on a /tmp file with os.setxattr(), a function which is just a wrapper around the Linux setxattr system call.  "man 2 setxattr" documents that the call can fail with ENOSPC (Errno 28) if "there is insufficient space remaining to store the extended attribute".  "man 5 attr", the overview of extended attribute support, notes that there are various kernel and file system specific limits on extended attributes, including length restrictions.  So presumably there may be legitimate reasons why these tests could get ENOSPC on particular system configurations.  It would be better if test_os anticipated such problems and passed those tests with a warning if ENOSPC is returned.

http://man7.org/linux/man-pages/man2/setxattr.2.html
http://man7.org/linux/man-pages/man5/attr.5.html
msg223528 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-07-20 19:03
If "insuffcient space" is insufficient disk space (ie: /tmp is full), I don't see any reason the test should cater to that possibility.  None of our other tests do.  If it means something else, then nevermind.
msg223529 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-07-20 19:10
My reading of the man page is that in the xattr case it can refer to conditions other than just file system full, e.g. https://bugzilla.kernel.org/show_bug.cgi?id=12793.  Also, Yannick reported that the volume was apparently not full.
msg348617 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-29 11:32
We don't have enough info to decide if we should ignore the error or not. I just close this old issue as out of date.
History
Date User Action Args
2019-07-29 11:32:21vstinnersetstatus: open -> closed

nosy: + vstinner
messages: + msg348617

resolution: out of date
stage: needs patch -> resolved
2014-07-20 19:10:47ned.deilysetmessages: + msg223529
2014-07-20 19:03:30r.david.murraysetnosy: + r.david.murray
messages: + msg223528
2014-07-20 03:16:03ned.deilysettitle: “make test” fails with 3.4.1 on Ubuntu 12.04 -> test_os extended attribute setxattr tests can fail with ENOSPC (Errno 28)
components: + Tests, - Build

keywords: + easy
nosy: + ned.deily
versions: + Python 3.5
messages: + msg223497
stage: needs patch
2014-07-19 16:10:07Hibou57create