freedomofpress / dangerzone

Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs
https://dangerzone.rocks/
GNU Affero General Public License v3.0
3.35k stars 152 forks source link

Segfault #830

Closed username227 closed 3 weeks ago

username227 commented 3 weeks ago

Hi,

I am getting a segfault when trying to run this program, and I was wondering if anyone has come across it before or how to fix. I am running it on Arch with Python 3.12. Here are the details:

`❯ gdb -ex r --args python /usr/bin/dangerzone
GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python...
(No debugging symbols found in python)
Starting program: /usr/bin/python /usr/bin/dangerzone
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffeea006c0 (LWP 6532)]
[New Thread 0x7fffee0006c0 (LWP 6533)]
[New Thread 0x7fffe7e006c0 (LWP 6534)]
[New Thread 0x7fffe74006c0 (LWP 6535)]
[New Thread 0x7fffe6a006c0 (LWP 6536)]

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff79830de in PyDict_GetItem () from /usr/lib/libpython3.12.so.1.0
(gdb) backtrace
#0  0x00007ffff79830de in PyDict_GetItem () at /usr/lib/libpython3.12.so.1.0
#1  0x00007ffff68d7584 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#2  0x00007ffff68d7617 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#3  0x00007ffff68d7617 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#4  0x00007ffff68d7617 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#5  0x00007ffff68d7617 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#6  0x00007ffff68d7617 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#7  0x00007ffff68d7617 in ??? ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#8  0x00007ffff68dabc6 in PySide::Property::getObject(_object*, _object*) ()
    at /usr/lib/libpyside2.cpython-312-x86_64-linux-gnu.so.5.15
#9  0x00007ffff0171ec0 in ??? ()
    at /usr/lib/python3.12/site-packages/PySide2/QtWidgets.cpython-312-x86_64-linux-gnu.so
#10 0x00007ffff797abeb in PyObject_SetAttr () at /usr/lib/libpython3.12.so.1.0
#11 0x00007ffff7893b05 in ??? () at /usr/lib/libpython3.12.so.1.0
#12 0x00007ffff7987f70 in _PyObject_FastCallDictTstate ()
--Type <RET> for more, q to quit, c to continue without paging--
    at /usr/lib/libpython3.12.so.1.0
#13 0x00007ffff79b4983 in ??? () at /usr/lib/libpython3.12.so.1.0
#14 0x00007ffff79854d3 in _PyObject_MakeTpCall ()
    at /usr/lib/libpython3.12.so.1.0
#15 0x00007ffff788bdfa in ??? () at /usr/lib/libpython3.12.so.1.0
#16 0x00007ffff79d53ac in ??? () at /usr/lib/libpython3.12.so.1.0
#17 0x00007ffff79d4e7e in ??? () at /usr/lib/libpython3.12.so.1.0
#18 0x00007ffff79b7dd0 in _PyObject_Call () at /usr/lib/libpython3.12.so.1.0
#19 0x00007ffff788cb8e in ??? () at /usr/lib/libpython3.12.so.1.0
#20 0x00007ffff79d53ac in ??? () at /usr/lib/libpython3.12.so.1.0
#21 0x00007ffff79d4eb1 in ??? () at /usr/lib/libpython3.12.so.1.0
#22 0x00007ffff788cb8e in ??? () at /usr/lib/libpython3.12.so.1.0
#23 0x00007ffff7987f70 in _PyObject_FastCallDictTstate ()
    at /usr/lib/libpython3.12.so.1.0
#24 0x00007ffff79b4dfd in _PyObject_Call_Prepend ()
    at /usr/lib/libpython3.12.so.1.0
#25 0x00007ffff7a85aa4 in ??? () at /usr/lib/libpython3.12.so.1.0
#26 0x00007ffff798550b in _PyObject_MakeTpCall ()
    at /usr/lib/libpython3.12.so.1.0
#27 0x00007ffff788bdfa in ??? () at /usr/lib/libpython3.12.so.1.0
#28 0x00007ffff7a3d767 in PyEval_EvalCode () at /usr/lib/libpython3.12.so.1.0
#29 0x00007ffff7a608b7 in ??? () at /usr/lib/libpython3.12.so.1.0
#30 0x00007ffff7a5b9dc in ??? () at /usr/lib/libpython3.12.so.1.0
--Type <RET> for more, q to quit, c to continue without paging--
#31 0x00007ffff7a74f33 in ??? () at /usr/lib/libpython3.12.so.1.0
#32 0x00007ffff7a74346 in _PyRun_SimpleFileObject () at /usr/lib/libpython3.12.so.1.0
#33 0x00007ffff7a73f88 in _PyRun_AnyFileObject () at /usr/lib/libpython3.12.so.1.0
#34 0x00007ffff7a6cc67 in Py_RunMain () at /usr/lib/libpython3.12.so.1.0
#35 0x00007ffff7a28fab in Py_BytesMain () at /usr/lib/libpython3.12.so.1.0
#36 0x00007ffff7639c88 in ??? () at /usr/lib/libc.so.6
#37 0x00007ffff7639d4c in __libc_start_main () at /usr/lib/libc.so.6
#38 0x0000555555555045 in _start ()
(gdb)`

Thanks for your help.
apyrgio commented 3 weeks ago

I think I recall what's going on here. Python 3.11 is the last version that PySide2 was compatible with. The Debian project has patched it to add support for Python 3.12, but this is probably not the case for Arch Linux.

In any case, I'd suggest testing with PySide6, which does support Python 3.12. Just keep in mind that Arch Linux is not a platform we support, so you may encounter more issues down the road :/

Closing this issue, but feel free to open a new one if you encounter something else.