Bug 137101 - Evolution LDAP address source won't timeout, indefinitely freezing ui
Summary: Evolution LDAP address source won't timeout, indefinitely freezing ui
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: All All
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:7.4.0 target:7.3.0.0.beta2 tar...
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-28 15:28 UTC by krumelmonster
Modified: 2021-12-22 05:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description krumelmonster 2020-09-28 15:28:47 UTC
I somehow managed to freeze libreoffice with an Evolution LDAP address source I set up (I'm not exactly sure yet on how to reproduce it because I don't know which address book/configuration causes this).

I tracked this issue down to libreoffice/connectivity/source/drivers/evoab2/NResultSet.cxx:479 e_book_client_connect_direct_sync(get_e_source_registry(), pSource, nullptr, nullptr); where the third argument is supposed to be the timeout for connecting to an address book. In 2015, there was an API change in libebook

https://gitlab.gnome.org/GNOME/evolution-data-server/-/commit/884fb8d872787d9c9e8132d4cfca47f275d9da3e#c9a7132d08790f78d45354801734fe3457a91e79_1641_1736

Libreoffice still has the old signature hard-coded in libreoffice/connectivity/source/drivers/evoab2/EApi.h:150 as e_book_client_connect_direct_sync(ESourceRegistry *registry, ESource *source, GCancellable *cancellable, GError **error) but the actual signature with current versions of libebook is e_book_client_connect_direct_sync(ESourceRegistry *registry, ESource *source, guint32 wait_for_connected_seconds, GCancellable *cancellable, GError **error).

This change goes back to at least the gnome 3.16 version.

I will try to libreoffice to the newer libebook api and see if this resolves this issue and maybe others I'm having with the Evolution LDAP address source.
Comment 1 krumelmonster 2020-09-28 15:33:42 UTC
I mean I will try to *port* libreoffice to the new api. bug 137070 is probably related.
Comment 2 krumelmonster 2020-09-28 15:56:54 UTC
Compatibility broke between 3.13 and 3.16 according to
https://abi-laboratory.pro/index.php?view=compat_report&l=evolution-data-server&v1=3_13_10&v2=3_16_5&obj=b5b11&kind=abi

but since 3.16, api in libebook has been stable according to this site. Pre-3.16 versions don't seem to have any relevance anymore (except you're using oldoldstable debian jessie which became unsupported in june) so I suggest we drop compatibility with these old versions of evolution-data-server.
Comment 3 krumelmonster 2020-09-29 11:21:03 UTC
My specific issue seems to arise from the evolution address source somehow looking for a local Evolution address book (I had added local evolution address books as a data source as well) called "Personal" which doesn't exist leading to an indefinite wait for the connection to that address book. I updated the signature as outlined above and set a timeout of 4 seconds, which mitigates this issue. bug 137070 persists after this change.
Comment 4 Julien Nabet 2021-12-13 21:06:50 UTC
Caolán: according to https://www.libreoffice.org/get-help/system-requirements/, LO needs Gnome 3.18 min so according to https://en.wikipedia.org/wiki/GNOME which has been released in September 2015.
The change on e_book_client_connect_direct_sync quoted by the reporter is in 2015 too.

Should we change our interface? Should we use some preprocessor ifdef ? Other?

Also I noticed in connectivity/source/drivers/evoab2/EApi.cxx
     23 static const char *eBookLibNames[] = {
     24     "libebook-1.2.so.20", // evolution-data-server 3.33.2+
     25     "libebook-1.2.so.19", // evolution-data-server 3.24+
     26     "libebook-1.2.so.16",
     27     "libebook-1.2.so.15",
     28     "libebook-1.2.so.14", // bumped again (evolution-3.6)
     29     "libebook-1.2.so.13", // bumped again (evolution-3.4)
     30     "libebook-1.2.so.12", // bumped again
     31     "libebook-1.2.so.10", // bumped again
     32     "libebook-1.2.so.9",  // evolution-2.8
     33     "libebook-1.2.so.5",  // evolution-2.4 and 2.6+
     34     "libebook-1.2.so.3",  // evolution-2.2
     35     "libebook.so.8"       // evolution-2.0
     36 };

Do we need to keep all of these?
Comment 5 krumelmonster 2021-12-14 10:53:27 UTC
I would suggest not to try to be compatible with pre 3.16 gnome abi and just update to the new signature.

Maybe add an assertion of EDS_CHECK_VERSION(3,16,0)
Comment 6 Caolán McNamara 2021-12-14 13:01:20 UTC
seeing as the abi broke, it does look like it makes sense to then write off anything before 3.16 and drop everything below libebook-1.2.so.16 and then unwind all the eds_check_version checks that then no longer make sense.
Comment 7 Julien Nabet 2021-12-15 21:55:38 UTC
Thank you Caolán for your feedback.
I submitted a patch here:
https://gerrit.libreoffice.org/c/core/+/126898
Comment 8 Commit Notification 2021-12-16 11:50:11 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0661c796c767802c114441ad9a17fd0979d72ef4

tdf#137101: fix e_book_client_connect_direct_sync signature in Evolution

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2021-12-16 13:38:17 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/674c6bf89a2ed89c889ef3f93639f8d5cddabd5c

tdf#137101: fix e_book_client_connect_direct_sync signature in Evolution

It will be available in 7.3.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2021-12-17 08:51:46 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/3b9210195b8d2ac9861a1e607455ff9d16eb68fd

tdf#137101: fix e_book_client_connect_direct_sync signature in Evolution

It will be available in 7.2.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2021-12-20 11:51:49 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-2-5":

https://git.libreoffice.org/core/commit/5e436d5812a3f38cc5cb46630ee41c4dc1d93a3d

tdf#137101: fix e_book_client_connect_direct_sync signature in Evolution

It will be available in 7.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.