Activity log for bug #1933973

Date Who What changed Old value New value Message
2021-06-29 11:55:06 zdohnal bug added bug
2021-06-29 11:55:06 zdohnal attachment added Proposed patch https://bugs.launchpad.net/bugs/1933973/+attachment/5507897/+files/hplip-pyssizet_clean.patch
2021-06-29 11:56:14 zdohnal bug watch added https://bugzilla.redhat.com/show_bug.cgi?id=1976465
2021-06-29 11:56:14 zdohnal bug task added hplip (Fedora)
2021-06-29 11:56:35 zdohnal description Hi, we have a report in Fedora rawhide[1] (), where Python3.10 is already introduced, and hpfax crashes there with SystemError: Truncated backtrace: device.py:558:probeDevices:SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats Traceback (most recent call last): File "/usr/lib/cups/backend/hpfax", line 151, in <module> probed_devices = device.probeDevices(['usb', 'par'], filter={'fax-type': (operator.gt, 0)}) File "/usr/share/hplip/base/device.py", line 558, in probeDevices result_code, data = hpmudext.probe_devices(bn) SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats The change which the message mentions happened in Python3.10[2]. It is based on PEP 353[3], which forbids int as a sequence indice, and introduces Py_ssize_t indices (most times 'typedef'ed ssize_t from glibc). The patch defines the mentioned macro in specific source files, and adds range checks for numeric variables coming from PyArg_ParseTuple(). It is because the length variable coming from the function is of Py_ssize_t, which is basically long int, and the hpmud functions uses int, so the value must be checked and adjusted in case it is bigger/smaller than INT_MAX/INT_MIN. Would you mind merging the patch? Thank you in advance, Zdenek [1] https://bugzilla.redhat.com/show_bug.cgi?id=1976465 [2] https://docs.python.org/3.10/whatsnew/3.10.html#id2 [3] https://www.python.org/dev/peps/pep-0353/ Hi, we have a report in Fedora rawhide[1], where Python3.10 is already introduced, and hpfax crashes there with SystemError: Truncated backtrace: device.py:558:probeDevices:SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats Traceback (most recent call last):   File "/usr/lib/cups/backend/hpfax", line 151, in <module>     probed_devices = device.probeDevices(['usb', 'par'], filter={'fax-type': (operator.gt, 0)})   File "/usr/share/hplip/base/device.py", line 558, in probeDevices     result_code, data = hpmudext.probe_devices(bn) SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats The change which the message mentions happened in Python3.10[2]. It is based on PEP 353[3], which forbids int as a sequence indice, and introduces Py_ssize_t indices (most times 'typedef'ed ssize_t from glibc). The patch defines the mentioned macro in specific source files, and adds range checks for numeric variables coming from PyArg_ParseTuple(). It is because the length variable coming from the function is of Py_ssize_t, which is basically long int, and the hpmud functions uses int, so the value must be checked and adjusted in case it is bigger/smaller than INT_MAX/INT_MIN. Would you mind merging the patch? Thank you in advance, Zdenek [1] https://bugzilla.redhat.com/show_bug.cgi?id=1976465 [2] https://docs.python.org/3.10/whatsnew/3.10.html#id2 [3] https://www.python.org/dev/peps/pep-0353/
2021-06-29 12:27:01 Bug Watch Updater hplip (Fedora): status Unknown In Progress
2021-06-29 12:27:01 Bug Watch Updater hplip (Fedora): importance Unknown Undecided
2021-07-12 01:24:11 Bug Watch Updater hplip (Fedora): status In Progress Fix Released