Public bug reported:

When running the test suite on 32-bit architectures that use 64-bit
time_t (e.g., modern armhf/i386 for Y2038 compliance),
test_server_simple_timeouts fails with OSError: [Errno 22] Invalid
argument.

Steps to Reproduce

Run autopkgtest or pytest on a 32-bit system with a 64-bit time_t
kernel. Run
tests/test_ssl.py::MiscSSLClientTestCase::test_server_simple_timeouts.

Actual Result (logs
https://objectstorage.prodstack5.canonical.com/swift/v1/AUTH_0f9aae918d5b4744bf7b827671c86842/autopkgtest-
resolute/resolute/armhf/m/m2crypto/20260113_215730_4a505@/log.gz)

E       OSError: [Errno 22] Invalid argument
/usr/lib/python3/dist-packages/M2Crypto/SSL/Connection.py:689: OSError

The M2Crypto.SSL.timeout.timeout.pack() method uses struct.pack("ll",
...) when m2.time_t_bits() == 64.

On standard 64-bit systems (x86_64), l is 8 bytes. ll = 16 bytes.
(Correct)

On 32-bit systems, l is 4 bytes. ll = 8 bytes. (Incorrect)

The kernel expects a 16-byte struct timeval (two 64-bit integers)
because of the Y2038-compliant 64-bit time_t. Passing an 8-byte
structure causes setsockopt to reject the call with EINVAL.

Proposed Fix: Change the packing format from "ll" to "qq" (long long).
This forces 8-byte integers on all platforms, ensuring the structure is
always 16 bytes when time_t is 64-bit.

** Affects: m2crypto (Ubuntu)
     Importance: Undecided
     Assignee: Ujjwal Sarswat (vmpyr)
         Status: In Progress

** Affects: m2crypto (Ubuntu Resolute)
     Importance: Undecided
     Assignee: Ujjwal Sarswat (vmpyr)
         Status: In Progress

** Affects: m2crypto (Debian)
     Importance: Unknown
         Status: Unknown


** Tags: update-excuse

** Description changed:

  When running the test suite on 32-bit architectures that use 64-bit
  time_t (e.g., modern armhf/i386 for Y2038 compliance),
  test_server_simple_timeouts fails with OSError: [Errno 22] Invalid
  argument.
  
  Steps to Reproduce
  
  Run autopkgtest or pytest on a 32-bit system with a 64-bit time_t
  kernel. Run
  tests/test_ssl.py::MiscSSLClientTestCase::test_server_simple_timeouts.
  
- Actual Result (logs here)
+ Actual Result (logs
+ 
https://objectstorage.prodstack5.canonical.com/swift/v1/AUTH_0f9aae918d5b4744bf7b827671c86842/autopkgtest-
+ resolute/resolute/armhf/m/m2crypto/20260113_215730_4a505@/log.gz)
  
  E       OSError: [Errno 22] Invalid argument
  /usr/lib/python3/dist-packages/M2Crypto/SSL/Connection.py:689: OSError
  The M2Crypto.SSL.timeout.timeout.pack() method uses struct.pack("ll", ...) 
when m2.time_t_bits() == 64.
  
  On standard 64-bit systems (x86_64), l is 8 bytes. ll = 16 bytes.
  (Correct)
  
  On 32-bit systems, l is 4 bytes. ll = 8 bytes. (Incorrect)
  
  The kernel expects a 16-byte struct timeval (two 64-bit integers)
  because of the Y2038-compliant 64-bit time_t. Passing an 8-byte
  structure causes setsockopt to reject the call with EINVAL.
  
  Proposed Fix: Change the packing format from "ll" to "qq" (long long).
  This forces 8-byte integers on all platforms, ensuring the structure is
  always 16 bytes when time_t is 64-bit.

** Description changed:

  When running the test suite on 32-bit architectures that use 64-bit
  time_t (e.g., modern armhf/i386 for Y2038 compliance),
  test_server_simple_timeouts fails with OSError: [Errno 22] Invalid
  argument.
  
  Steps to Reproduce
  
  Run autopkgtest or pytest on a 32-bit system with a 64-bit time_t
  kernel. Run
  tests/test_ssl.py::MiscSSLClientTestCase::test_server_simple_timeouts.
  
  Actual Result (logs
  
https://objectstorage.prodstack5.canonical.com/swift/v1/AUTH_0f9aae918d5b4744bf7b827671c86842/autopkgtest-
  resolute/resolute/armhf/m/m2crypto/20260113_215730_4a505@/log.gz)
  
  E       OSError: [Errno 22] Invalid argument
  /usr/lib/python3/dist-packages/M2Crypto/SSL/Connection.py:689: OSError
- The M2Crypto.SSL.timeout.timeout.pack() method uses struct.pack("ll", ...) 
when m2.time_t_bits() == 64.
+ 
+ The M2Crypto.SSL.timeout.timeout.pack() method uses struct.pack("ll",
+ ...) when m2.time_t_bits() == 64.
  
  On standard 64-bit systems (x86_64), l is 8 bytes. ll = 16 bytes.
  (Correct)
  
  On 32-bit systems, l is 4 bytes. ll = 8 bytes. (Incorrect)
  
  The kernel expects a 16-byte struct timeval (two 64-bit integers)
  because of the Y2038-compliant 64-bit time_t. Passing an 8-byte
  structure causes setsockopt to reject the call with EINVAL.
  
  Proposed Fix: Change the packing format from "ll" to "qq" (long long).
  This forces 8-byte integers on all platforms, ensuring the structure is
  always 16 bytes when time_t is 64-bit.

** Bug watch added: Debian Bug tracker #1126257
   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1126257

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2138933

Title:
  OSError: [Errno 22] Invalid argument in set_socket_read_timeout on
  32-bit architectures with 64-bit time_t

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/m2crypto/+bug/2138933/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to