[Python-modules-team] Bug#938965: Alsaseq constants are wrong
François Mazen
francois at mzf.fr
Fri Aug 30 14:21:14 BST 2019
Package: python3-pyalsa
Version: 1.1.6-2
Dear Maintainer,
upgrading python3-pyalsa from version 1.0.29-1 (python2) to version
1.1.6-2 (python3) changes the values of the alsaseq constants like
SEQ_OPEN_OUTPUT.
Then alsaseq.Sequencer call with theses constants fails with message:
OverflowError: signed integer is greater than maximum
If I replace the constant by their integer values, like 1 for
SEQ_OPEN_OUTPUT, no error raised.
To reproduce, in python3 interactive console with python3-pyalsa 1.1.6-
2 (Debian Unstable):
-----------------
Python 3.7.4 (default, Aug 21 2019, 16:01:23)
[GCC 9.2.1 20190813] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyalsa import alsaseq
>>> sequencer = alsaseq.Sequencer(name='default',
... clientname="solfege-alsa.py",
... streams=alsaseq.SEQ_OPEN_OUTPUT,
... mode=alsaseq.SEQ_NONBLOCK)
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
OverflowError: signed integer is greater than maximum
>>> alsaseq.SEQ_OPEN_OUTPUT
SEQ_OPEN_OUTPUT(0x1)
>>> alsaseq.SEQ_OPEN_OUTPUT.real
3495274726
>>> sequencer = alsaseq.Sequencer(name='default',
... clientname="solfege-alsa.py",
... streams=1,
... mode=1)
>>> sequencer
<alsaseq.Sequencer name=default client_id=128 clientname=solfege-
alsa.py streams=1 mode=1 at 0x0x7fddd057eab0>
-----------------
Same commands in python2 interactive console with python-pyalsa 1.0.29-
1 (Debian Stretch):
-----------------
Python 2.7.13 (default, Sep 26 2018, 18:42:22)
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyalsa import alsaseq
>>> sequencer = alsaseq.Sequencer(name='default',
... clientname="solfege-alsa.py",
... streams=alsaseq.SEQ_OPEN_OUTPUT,
... mode=alsaseq.SEQ_NONBLOCK)
>>> sequencer
<alsaseq.Sequencer name=default client_id=128 clientname=solfege-
alsa.py streams=1 mode=1 at 0x0x7f25bac7a880>
>>> alsaseq.SEQ_OPEN_OUTPUT
1
>>> alsaseq.SEQ_OPEN_OUTPUT.real
1
-----------------
It looks like the Constant class does not return the right value for
SEQ_OPEN_OUTPUT (3495274726 instead of 1) in 1.1.6-2 version. This
leads to the integer overflow because 3495274726 is greater than the
typical signed integer upper limit (2147483647).
I've found the behavior change while trying to fix the Bug#935535 [1]:
solfege: crashes with python3-pyalsa installed
Thanks,
François
[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935535
More information about the Python-modules-team
mailing list