Skip to content

test_os extended attribute setxattr tests can fail with ENOSPC (Errno 28) #66210

Description

@Hibou57
mannequin
BPO 22011
Nosy @vstinner, @ned-deily, @bitdancer
Files
  • test-logs.tar.gz: contains stderr-test.txt and stdout-test.txt
  • 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 2019-07-29.11:32:21.690>
    created_at = <Date 2014-07-19.16:10:07.687>
    labels = ['easy', 'tests']
    title = 'test_os extended attribute setxattr tests can fail with ENOSPC (Errno 28)'
    updated_at = <Date 2019-07-29.11:32:21.689>
    user = 'https://bugs.python.org/Hibou57'

    bugs.python.org fields:

    activity = <Date 2019-07-29.11:32:21.689>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-29.11:32:21.690>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2014-07-19.16:10:07.687>
    creator = 'Hibou57'
    dependencies = []
    files = ['35996']
    hgrepos = []
    issue_num = 22011
    keywords = ['easy']
    message_count = 5.0
    messages = ['223468', '223497', '223528', '223529', '348617']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'ned.deily', 'r.david.murray', 'Hibou57']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue22011'
    versions = ['Python 3.4', 'Python 3.5']

    Activity

    1. Hibou57 commented on Jul 19, 2014

      Hibou57mannequin
      MannequinAuthor

      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.

    2. added
      buildThe build process and cross-build
      on Jul 19, 2014
    3. ned-deily commented on Jul 20, 2014

      @ned-deily
      Member

      (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

    4. added
      testsTests in the Lib/test dir
      and removed
      buildThe build process and cross-build
      on Jul 20, 2014
    5. changed the title [-]“make test” fails with 3.4.1 on Ubuntu 12.04[/-] [+]test_os extended attribute setxattr tests can fail with ENOSPC (Errno 28)[/+] on Jul 20, 2014
    6. bitdancer commented on Jul 20, 2014

      @bitdancer
      Member

      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.

    7. ned-deily commented on Jul 20, 2014

      @ned-deily
      Member

      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.

    8. vstinner commented on Jul 29, 2019

      @vstinner
      Member

      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.

    9. transferred this issue fromon Apr 10, 2022
    10. terryjreedy commented on Nov 16, 2024

      @terryjreedy
      Member

      #126909 continues this with more information.

    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

      easytestsTests in the Lib/test dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions