Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_hashlib failure on Ubuntu 16.04 #73722

Closed
sachinkum mannequin opened this issue Feb 11, 2017 · 5 comments
Closed

test_hashlib failure on Ubuntu 16.04 #73722

sachinkum mannequin opened this issue Feb 11, 2017 · 5 comments
Labels
3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@sachinkum
Copy link
Mannequin

sachinkum mannequin commented Feb 11, 2017

BPO 29536
Nosy @tiran, @vadmium, @zhangyangyu, @sachinkum
Files
  • blake2b.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 2017-02-15.17:59:11.472>
    created_at = <Date 2017-02-11.21:27:48.090>
    labels = ['3.7', 'invalid', 'type-bug', 'tests']
    title = 'test_hashlib failure on Ubuntu 16.04'
    updated_at = <Date 2017-02-15.17:59:11.470>
    user = 'https://github.com/sachinkum'

    bugs.python.org fields:

    activity = <Date 2017-02-15.17:59:11.470>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-02-15.17:59:11.472>
    closer = 'christian.heimes'
    components = ['Tests']
    creation = <Date 2017-02-11.21:27:48.090>
    creator = 'Sachin Kumar'
    dependencies = []
    files = ['46639']
    hgrepos = []
    issue_num = 29536
    keywords = []
    message_count = 5.0
    messages = ['287626', '287815', '287825', '287874', '287876']
    nosy_count = 4.0
    nosy_names = ['christian.heimes', 'martin.panter', 'xiang.zhang', 'Sachin Kumar']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue29536'
    versions = ['Python 3.7']

    @sachinkum
    Copy link
    Mannequin Author

    sachinkum mannequin commented Feb 11, 2017

    When executing
    ./python -m test -v test_hashlib
    on Python 3.7, the test fails.

    This is the complete traceback:

    CPython 3.7.0a0 (default, Feb 8 2017, 03:10:42) [GCC 5.4.0 20160609]
    == Linux-4.4.0-62-generic-x86_64-with-debian-stretch-sid little-endian
    == hash algorithm: siphash24 64bit
    == cwd: /XXX/build/test_python_14437
    == encodings: locale=UTF-8, FS=utf-8
    Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
    Run tests sequentially
    0:00:00 [1/1] test_hashlib
    test_algorithms_available (test.test_hashlib.HashLibTestCase) ... ok
    test_algorithms_guaranteed (test.test_hashlib.HashLibTestCase) ... ok
    test_blake2b (test.test_hashlib.HashLibTestCase) ... ok
    test_blake2b_vectors (test.test_hashlib.HashLibTestCase) ... ERROR
    test_blake2s (test.test_hashlib.HashLibTestCase) ... ok
    test_blake2s_vectors (test.test_hashlib.HashLibTestCase) ... ERROR
    test_blocksize_name (test.test_hashlib.HashLibTestCase) ... ok
    test_blocksize_name_blake2 (test.test_hashlib.HashLibTestCase) ... ok
    test_blocksize_name_sha3 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_blake2b_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_blake2b_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_blake2s_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_blake2s_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_md5_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_md5_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_md5_2 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_md5_huge (test.test_hashlib.HashLibTestCase) ... skipped 'not enough memory: 4.0G minimum needed'
    test_case_md5_uintmax (test.test_hashlib.HashLibTestCase) ... skipped 'not enough memory: 4.0G minimum needed'
    test_case_sha1_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha1_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha1_2 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha1_3 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha224_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha224_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha224_2 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha224_3 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha256_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha256_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha256_2 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha256_3 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha384_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha384_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha384_2 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha384_3 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha3_224_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha3_224_vector (test.test_hashlib.HashLibTestCase) ... ERROR
    test_case_sha3_256_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha3_256_vector (test.test_hashlib.HashLibTestCase) ... ERROR
    test_case_sha3_384_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha3_384_vector (test.test_hashlib.HashLibTestCase) ... ERROR
    test_case_sha3_512_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha3_512_vector (test.test_hashlib.HashLibTestCase) ... ERROR
    test_case_sha512_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha512_1 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha512_2 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_sha512_3 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_shake128_vector (test.test_hashlib.HashLibTestCase) ... ERROR
    test_case_shake256_vector (test.test_hashlib.HashLibTestCase) ... ERROR
    test_case_shake_128_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_case_shake_256_0 (test.test_hashlib.HashLibTestCase) ... ok
    test_extra_sha3 (test.test_hashlib.HashLibTestCase) ... ok
    test_get_builtin_constructor (test.test_hashlib.HashLibTestCase) ... ok
    test_gil (test.test_hashlib.HashLibTestCase) ... ok
    test_hash_array (test.test_hashlib.HashLibTestCase) ... ok
    test_hexdigest (test.test_hashlib.HashLibTestCase) ... ok
    test_large_update (test.test_hashlib.HashLibTestCase) ... ok
    test_name_attribute (test.test_hashlib.HashLibTestCase) ... ok
    test_no_unicode (test.test_hashlib.HashLibTestCase) ... ok
    test_no_unicode_blake2 (test.test_hashlib.HashLibTestCase) ... ok
    test_no_unicode_sha3 (test.test_hashlib.HashLibTestCase) ... ok
    test_threaded_hashing (test.test_hashlib.HashLibTestCase) ... ok
    test_unknown_hash (test.test_hashlib.HashLibTestCase) ... ok
    test_pbkdf2_hmac_c (test.test_hashlib.KDFTests) ... ok
    test_pbkdf2_hmac_py (test.test_hashlib.KDFTests) ... ok
    test_scrypt (test.test_hashlib.KDFTests) ... skipped ' test requires OpenSSL > 1.1'

    ======================================================================
    ERROR: test_blake2b_vectors (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 623, in test_blake2b_vectors
        for msg, key, md in read_vectors('blake2b'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_blake2s_vectors (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 648, in test_blake2s_vectors
        for msg, key, md in read_vectors('blake2s'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_case_sha3_224_vector (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 659, in test_case_sha3_224_vector
        for msg, md in read_vectors('sha3_224'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_case_sha3_256_vector (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 669, in test_case_sha3_256_vector
        for msg, md in read_vectors('sha3_256'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_case_sha3_384_vector (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 680, in test_case_sha3_384_vector
        for msg, md in read_vectors('sha3_384'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_case_sha3_512_vector (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 691, in test_case_sha3_512_vector
        for msg, md in read_vectors('sha3_512'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_case_shake128_vector (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 703, in test_case_shake128_vector
        for msg, md in read_vectors('shake_128'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    ======================================================================
    ERROR: test_case_shake256_vector (test.test_hashlib.HashLibTestCase)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/XXX/Lib/test/test_hashlib.py", line 715, in test_case_shake256_vector
        for msg, md in read_vectors('shake_256'):
      File "/XXX/Lib/test/test_hashlib.py", line 69, in read_vectors
        parts[0] = bytes.fromhex(parts[0])
    ValueError: non-hexadecimal number found in fromhex() arg at position 0

    Ran 65 tests in 0.877s

    FAILED (errors=8, skipped=3)
    test test_hashlib failed
    test_hashlib failed

    1 test failed:
    test_hashlib

    Total duration: 1 sec
    Tests result: FAILURE

    @sachinkum sachinkum mannequin added 3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Feb 11, 2017
    @zhangyangyu
    Copy link
    Member

    I am using 16.10 but I can't reproduce the failures. Sachin can you reliably reproduce the failures? And one thing interesting is that all the failed test cases need the network source to be enabled but your command doesn't do that, it's better to use ./python -m test -uall -v test_hashlib.

    @vadmium
    Copy link
    Member

    vadmium commented Feb 15, 2017

    Looks like the tests should run if the data is already downloaded. First run needs -u urlfetch. My guess is your data is somehow corrupted. Check out your copy of the files in Lib/test/data/, compare them to e.g. <http://www.pythontest.net/hashlib/blake2b.txt\>. If you delete the files and re-run the test, you should get a fresh copy.

    If my theory is correct, I wonder how the data got corrupted.

    @sachinkum
    Copy link
    Mannequin Author

    sachinkum mannequin commented Feb 15, 2017

    @xiang
    I tried that command earlier but that returned around 8 failed test cases. I think it is due to a fault with my connection. Although I can replicate this error every time. I've tried over 5 times already.

    @martin
    I compared the data. My file has been attached. Deleting the files fixed the issue. Can all the test files be deleted safely, since some other tests are failing too?

    @tiran
    Copy link
    Member

    tiran commented Feb 15, 2017

    Yeah, somehow you ended up with a broken vector file. Your file contains HTTP with JavaScript redirect. Did you attempt to download test data from a hotel or airport wifi?

    You can safely remove Lib/test/data and start over.

    @tiran tiran closed this as completed Feb 15, 2017
    @tiran tiran added the invalid label Feb 15, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants