don't decref borrowed references
alsa-project/alsa-python pull request #19 was opened from florolf: This has always been wrong, but since Python 3.14 restructured some memory management code in https://github.com/python/cpython/commit/5716cc352940a5f8557a8191e873837aa61..., this now causes Python to segfault: ```shell-session $ cat a.py from pyalsa import alsamixer m=alsamixer.Mixer() m.attach() m.load() e=alsamixer.Element(m, 'Master') e.set_volume_tuple([0,0]) $ $ for i in $(seq 1 100); do python -Xfaulthandler a.py || break; done Fatal Python error: Segmentation fault Current thread 0x00007f01f2854b80 [python] (most recent call first): Garbage-collecting <no Python frame> Current thread's C stack trace (most recent call first): Binary file "/usr/lib/libpython3.14.so.1.0", at _Py_DumpStack+0x4d [0x7f01f233731c] Binary file "/usr/lib/libpython3.14.so.1.0", at +0x13c250 [0x7f01f233c250] Binary file "/usr/lib/libc.so.6", at +0x3e2d0 [0x7f01f204d2d0] Binary file "/usr/lib/libpython3.14.so.1.0", at +0x21960d [0x7f01f241960d] Binary file "/usr/lib/libpython3.14.so.1.0", at +0x219187 [0x7f01f2419187] Binary file "/usr/lib/libpython3.14.so.1.0", at +0x26bf38 [0x7f01f246bf38] Binary file "/usr/lib/libpython3.14.so.1.0", at +0x28ff64 [0x7f01f248ff64] Binary file "/usr/lib/libpython3.14.so.1.0", at Py_RunMain+0x37a [0x7f01f245e59a] Binary file "/usr/lib/libpython3.14.so.1.0", at Py_BytesMain+0x3b [0x7f01f2457c6b] Binary file "/usr/lib/libc.so.6", at +0x276c1 [0x7f01f20366c1] Binary file "/usr/lib/libc.so.6", at __libc_start_main+0x89 [0x7f01f20367f9] Binary file "python", at _start+0x25 [0x55f22cd3e045] Extension modules: pyalsa.alsamixer (total: 1) ``` This PR fixes all instances of this behavior in the code base. Request URL : https://github.com/alsa-project/alsa-python/pull/19 Patch URL : https://github.com/alsa-project/alsa-python/pull/19.patch Repository URL: https://github.com/alsa-project/alsa-python
participants (1)
-
GitHub pull_request - opened