FS#69990 - [gtk3] tracker3 pulls libsqlite into the process, breaking sqlcipher

Attached to Project: Arch Linux
Opened by kpcyrd (kpcyrd) - Sunday, 14 March 2021, 23:38 GMT
Last edited by Jan Alexander Steffens (heftig) - Monday, 15 March 2021, 15:19 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 21
Private No

Details

Description:

A recent change in gtk3 enabled tracker3, this causes sqlite to be loaded into the process:

```
% ldd /lib/libgtk-3.so | grep sqlite
libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0x0000648991f83000)
```

This is a problem if the application depends on libgtk, but also uses SQLCipher (a special build of sqlite with encryption). It seems that it's not possible to use both SQLCipher and the regular sqlite at the same time, as mentioned by a SQLCipher developer: https://discuss.zetetic.net/t/is-the-multiple-sqlite-problem-an-issue-for-sqlcipher-for-android/1449/2

(Thanks to @richardschuetz on github for pointing this out)

I'd recommend to disable tracker3 again since it's currently still off by default.

Additional info:
* gtk3-3.24.27-3 (https://github.com/archlinux/svntogit-packages/commit/9f1ec21c5fc3d83273d8b38d2065485bdfd3c97e#diff-3e341d2d9c67be01819b25b25d5e53ea3cdf3a38d28846cda85a195eb9b7203a)
* https://github.com/signalapp/Signal-Desktop/issues/4513#issuecomment-798778478
* https://github.com/signalapp/Signal-Desktop/issues/5097
* https://bugs.archlinux.org/task/69971

Steps to reproduce:
- Use an application that uses both sqlcipher and gtk
- Upgrade gtk3 to 3.24.27-3
- Try to restart the application

Expected result:
- Everything still works

Actual result:
- The application can't read the existing database anymore
- New databases are going to be created unencrypted
This task depends upon

Closed by  Jan Alexander Steffens (heftig)
Monday, 15 March 2021, 15:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  gtk3 3.24.27-4
Comment by Jan Alexander Steffens (heftig) - Monday, 15 March 2021, 00:17 GMT
Please try to fix this in the app. I recommend linking SQLCipher statically so the application doesn't try to use the dynamic library, or loading SQLCipher via dlopen with RTLD_LOCAL|RTLD_DEEPBIND to keep it self-contained.
Comment by Jan Alexander Steffens (heftig) - Monday, 15 March 2021, 00:31 GMT
Or use symbol versioning in libsqlcipher.
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 15 March 2021, 02:36 GMT
We can’t fix all of them. This also breaks mailspring, element…

Regarding element, modifying the build process is extremely hard as this is built as an external node module somewhere deep in the dependency chain.
Comment by Ícar N. S. (juxuanu) - Monday, 15 March 2021, 12:44 GMT
This seems related to tracker3 failing to start.

```
: tracker-miner-fs-3.service: start operation timed out. Terminating.
: tracker-miner-fs-3.service: Failed with result 'timeout'.
: Failed to start Tracker file system data miner.
: tracker-miner-fs-3.service: Scheduled restart job, restart counter is at 103.
: Stopped Tracker file system data miner.
: Starting Tracker file system data miner.
```

this causes high CPU usage. Also, Gnome programs such as gnome-music doesn't work because they depend on tracker3 providing the file information
Comment by kpcyrd (kpcyrd) - Monday, 15 March 2021, 13:28 GMT
Can we revert this release anyway so we have more time to come up with a proper solution, if there is any?
Comment by Adel KARA SLIMANE (adelks) - Monday, 15 March 2021, 13:59 GMT
I had opened an issue in Gnome's tracker-miners Gitlab before thinking of looking up the issue here. Here's the link for the upstream issue https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/161. @heftig: maybe use that issue to make your suggestion to link SQLCipher statically, or at least have a talk with the devs ? As this seems to be something that needs to be figured out with upstream devs. Otherwise that issue can safely be closed, then.

Mailspring is broken, too, on my computer.
Comment by Jan Alexander Steffens (heftig) - Monday, 15 March 2021, 15:19 GMT
Reverted in gtk3 3.24.27-4, but note I intend to enable tracker3 again in the future.

Loading...