After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655499 - Don't crash when getting contacts before backend is opened
Don't crash when getting contacts before backend is opened
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.2.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2011-07-28 11:52 UTC by Raul Gutierrez Segales
Modified: 2013-09-14 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds patch (21.04 KB, patch)
2011-08-01 13:58 UTC, Milan Crha
committed Details | Review

Description Raul Gutierrez Segales 2011-07-28 11:52:00 UTC
Programmers might sometimes forget to call open() (or open_sync):

client = EBook.BookClient.new_system()
query_string = "(contains \"x-evolution-any-field\" \"\")"
ret  = client.get_contacts_sync(query_string, None)

which causes e-addressbook-factory to crash with:

(e-addressbook-factory:13305): libedata-book-CRITICAL **: e_book_backend_summary_is_summary_query: assertion `summary != NULL' failed

Program received signal SIGSEGV, Segmentation fault.

Thread 140737315383040 (LWP 13309)

  • #0 e_book_backend_file_get_contact_list
    at e-book-backend-file.c line 456
  • #1 book_backend_get_contact_list
  • #2 operation_thread
    at e-data-book.c line 154
  • #3 g_thread_pool_thread_proxy
    at gthreadpool.c line 319
  • #4 g_thread_create_proxy
    at gthread.c line 1954
  • #5 start_thread
    at pthread_create.c line 305
  • #6 clone
    at ../sysdeps/unix/sysv/linux/x86_64/clone.S line 115

because db is null.

So we should check if the addressbook is open and return an error if it isn't.
Comment 1 Milan Crha 2011-07-29 12:03:05 UTC
Thanks for the bug report, I agree. The only question is whether control this in an upper level, like EBook/CalBackend, or in each descendant. The first seems to me better.
Comment 2 Milan Crha 2011-08-01 13:58:13 UTC
Created attachment 192982 [details] [review]
eds patch

for evolution-data-server;

This covers both, fix in file addressbook backend and checking in backend base class whether the backend is opened or not, returning an error when it is not opened. The later for both calendar and address book.

It worked fine with my tests, but please let me know if you find any regression with this change. Thanks in advance.
Comment 3 Milan Crha 2011-08-01 14:00:14 UTC
Created commit 68646a9 in eds master (3.1.5+)