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

Dangerzone segfaults on Fedora 39/40 #801

Closed apyrgio closed 1 month ago

apyrgio commented 1 month ago

It has come to our attention that Fedora 39/40 users, who have updated their systems after Saturday, May 4th, cannot run Dangerzone. Opening the application via the desktop icon seems to do nothing, but if you open it through the CLI, you may see a segmentation fault similar to this:

$ PYTHONFAULTHANDLER=1  dangerzone                                                                                                                                                                        
Fatal Python error: Segmentation fault                                                                                 

Current thread 0x00007fed65981b80 (most recent call first):                           
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1289 in create_module
  File "<frozen importlib._bootstrap>", line 813 in module_from_spec        
  File "<frozen importlib._bootstrap>", line 921 in _load_unlocked          
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load                       
  File "/usr/lib64/python3.12/site-packages/shiboken6/__init__.py", line 27 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed     
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module        
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked                
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib64/python3.12/site-packages/PySide6/__init__.py", line 64 in _setupQtDirectories
  File "/usr/lib64/python3.12/site-packages/PySide6/__init__.py", line 124 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3.12/site-packages/dangerzone/gui/__init__.py", line 20 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/lib/python3.12/site-packages/dangerzone/__init__.py", line 16 in <module>
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 995 in exec_module
  File "<frozen importlib._bootstrap>", line 935 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1331 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1360 in _find_and_load
  File "/usr/bin/dangerzone", line 5 in <module>
Segmentation fault (core dumped)

It seems that a recent Fedora patch in the Python 3.12 package (python3.12-3.12.3-2) has caused a regression when importing Pyside6.

PySide6 is an integral component of Dangerzone and, while we offer our own Fedora package for it, the regression occurs even with PySide6 installed from PyPI. So, at this point we have to wait for the Fedora maintainers to take a look at this bug report and offer a solution (possibly reverting the offending Python3 patch).

If you are affected, please follow this issue. We are monitoring the situation and we'll update it once we learn more.

apyrgio commented 1 month ago

Fedora happens to offer some official PySide6 packages for Fedora Rawhide (41).

I have tested the following packages in Fedora 39:

With the latest Python3 3.12.3 and these packages, Dangerzone still does not work. Also, because Fedora 39 ships with Qt 6.6.2, only these packages can be tested.

I've also tested the following packages in Fedora 40:

With the latest Python3 3.12.3 and these packages, Dangerzone works. However, I'm hesitant to include them in our repos, since they are built for a different OS version (Fedora 41). If any Fedora 40 user is affected by this issue, and they want to experiment :test_tube: with this workaround, they can:

  1. Download these files locally.
  2. Install them and report back if Dangerzone works for them.
apyrgio commented 1 month ago

There's a promising update on Qt's bug tracker for this issue (PYSIDE-2747). As of May 18th, the Shiboken6 wheels no longer segfault on import. Most like a 6.7.1 release will fix this problem.

almet commented 1 month ago

🥁 … And Pyside6 6.7.1 has just been released!

apyrgio commented 1 month ago

We have just updated our Dangerzone and PySide6 RPMs in order to fix this issue. More specifically, PySide6 6.7.1 fixes the segfault issue that our users are experiencing, and we now offer this package from our YUM repo.

Feel free to test them out and let us know if you encounter any problems.