bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
1.9k stars 175 forks source link

fix(gui): remove ExtraMouseButtonEventFilter when closing (#1095) #1768

Closed DerekVeit closed 1 day ago

DerekVeit commented 6 days ago

Fix #1095

buhtz commented 6 days ago

Forget it myself. Please add a line to the CHANGES file. Something like this:

fix(gui): Fix Qt segmentation fault with uninstall ExtraMouseButtonEventFilter when closing main window (#1095)
DerekVeit commented 5 days ago

Thanks, Christian. I hope I understood correctly. I amended that to the previous commit. Feel free to point out anything I do not quite right. I'll be happy to revise again. I hope to be making more contributions.

buhtz commented 3 days ago

I used your script and confirm it might work. With your fix I can start-stop BIT 1000 times without seg fault. But without the fix I do have ~50% of seg faults.

DerekVeit commented 2 days ago

I tried it with and without the fix on a few different versions, with Python 3.8, 3.10, 3.12 and BIT 1.2.1, 1.3.2, 1.4.3, 1.4.4-dev (not every combination). I didn't keep statistics, but without the fix, I got segfaults roughly half the time except with 1.4.4-dev and Qt6. With the Qt6 build, the segfaults were much less frequent but did still happen.

It seems there must be some race in the QApplication destruction that determines whether it will have the segfault, and that timing is a bit different with my Qt6 build. Little things, like whether files are in cache, seem to affect it.

But with the fix, I never got a segfault on any version.