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 755410 - [UOA] Incorrect ESource unref in e_signon_session_password_get()
[UOA] Incorrect ESource unref in e_signon_session_password_get()
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
3.16.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2015-09-22 11:45 UTC by Sebastien Bacher
Modified: 2015-09-23 17:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastien Bacher 2015-09-22 11:45:52 UTC
Using eds 3.16.5 on Ubuntu wily, I get that evolution-source-registry invalid read when toggling e-d-s/google contacts in the ubuntu-online-account settings

"==23593== Invalid read of size 4
==23593==    at 0x4E1EAE2: g_type_check_instance_is_a (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4895E8F: e_oauth2_support_get_access_token (in /usr/lib/libebackend-1.2.so.10.0.0)
==23593==    by 0x9133210: ubuntu_online_accounts_get_access_token_sync (in /usr/lib/evolution-data-server/registry-modules/module-ubuntu-online-accounts.so)
==23593==    by 0x4895D3D: e_oauth2_support_get_access_token_sync (in /usr/lib/libebackend-1.2.so.10.0.0)
==23593==    by 0x4899A6B: server_side_source_get_oauth2_access_token_sync (in /usr/lib/libebackend-1.2.so.10.0.0)
==23593==    by 0x493B6AF: e_source_get_oauth2_access_token_sync (in /usr/lib/libedataserver-1.2.so.20.0.0)
==23593==    by 0xAEB0E99: e_webdav_discover_sources_sync (in /usr/lib/evolution-data-server/registry-modules/module-google-backend.so)
==23593==    by 0xAEAD5AD: google_backend_authenticate_sync (in /usr/lib/evolution-data-server/registry-modules/module-google-backend.so)
==23593==    by 0x488DBF2: backend_source_authenticate_thread (in /usr/lib/libebackend-1.2.so.10.0.0)
==23593==    by 0x4EB9299: g_thread_proxy (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4F781A9: start_thread (pthread_create.c:333)
==23593==    by 0x5078FDD: clone (clone.S:122)
==23593==  Address 0x7cbcaf8 is 200 bytes inside a block of size 224 free'd
==23593==    at 0x482D358: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==23593==    by 0x4E9721F: g_free (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4EAF102: g_slice_free1 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4E1DE86: g_type_free_instance (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4DFF4DC: g_object_unref (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4941D7C: async_context_free (in /usr/lib/libedataserver-1.2.so.20.0.0)
==23593==    by 0x4CA8259: g_task_finalize (in /usr/lib/i386-linux-gnu/libgio-2.0.so.0.4507.0)
==23593==    by 0x4DFF4D4: g_object_unref (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4E8E4C7: g_source_callback_unref (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4E8EF29: g_source_destroy_internal (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4E91C86: g_main_context_dispatch (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4E91FD8: g_main_context_iterate.isra.29 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x4E92388: g_main_loop_run (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==23593==    by 0x48951B2: dbus_server_run_server (in /usr/lib/libebackend-1.2.so.10.0.0)
==23593==    by 0x5F32D11: ffi_call_SYSV (in /usr/lib/i386-linux-gnu/libffi.so.6.0.4)
==23593==    by 0x5F3298B: ffi_call (in /usr/lib/i386-linux-gnu/libffi.so.6.0.4)
==23593==    by 0x4DFB642: g_cclosure_marshal_generic_va (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4DF92A1: g_type_class_meta_marshalv (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4DFAC8E: _g_closure_invoke_va (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4E15078: g_signal_emit_valist (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x4E15644: g_signal_emit (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==23593==    by 0x48954CA: e_dbus_server_run (in /usr/lib/libebackend-1.2.so.10.0.0)
==23593==    by 0x10B900: main (in /usr/lib/evolution/evolution-source-registry)"


Unsure if that could be the same as bug #755347
Comment 1 Sebastien Bacher 2015-09-22 11:48:15 UTC
those warnings are displayed on the stdout

file uoa-utils.c: line 628 (e_source_get_ag_service_type): should not be reached

ubuntu_online_accounts_ref_account_service: assertion 'service_type != NULL' failed

g_string_free: assertion 'string != NULL' failed
Comment 2 Sebastien Bacher 2015-09-22 11:49:53 UTC
other errors

==22793== Invalid read of size 4
==22793==    at 0x4E1EAE2: g_type_check_instance_is_a (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x493A7F4: e_source_set_connection_status (in /usr/lib/libedataserver-1.2.so.20.0.0)
==22793==    by 0x488DB3E: backend_source_authenticate_thread (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x4EB9299: g_thread_proxy (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4F781A9: start_thread (pthread_create.c:333)
==22793==    by 0x5078FDD: clone (clone.S:122)
==22793==  Address 0x7cc4310 is 200 bytes inside a block of size 224 free'd
==22793==    at 0x482D358: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==22793==    by 0x4E9721F: g_free (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4EAF102: g_slice_free1 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E1DE86: g_type_free_instance (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4DFF4DC: g_object_unref (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4941D7C: async_context_free (in /usr/lib/libedataserver-1.2.so.20.0.0)
==22793==    by 0x4CA8259: g_task_finalize (in /usr/lib/i386-linux-gnu/libgio-2.0.so.0.4507.0)
==22793==    by 0x4DFF4D4: g_object_unref (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4E8E4C7: g_source_callback_unref (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E8EF29: g_source_destroy_internal (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E91C86: g_main_context_dispatch (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E91FD8: g_main_context_iterate.isra.29 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E92388: g_main_loop_run (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x48951B2: dbus_server_run_server (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x5F32D11: ffi_call_SYSV (in /usr/lib/i386-linux-gnu/libffi.so.6.0.4)
==22793==    by 0x5F3298B: ffi_call (in /usr/lib/i386-linux-gnu/libffi.so.6.0.4)
==22793==    by 0x4DFB642: g_cclosure_marshal_generic_va (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4DF92A1: g_type_class_meta_marshalv (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4DFAC8E: _g_closure_invoke_va (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4E15078: g_signal_emit_valist (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4E15644: g_signal_emit (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x48954CA: e_dbus_server_run (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x10B900: main (in /usr/lib/evolution/evolution-source-registry)
Comment 3 Sebastien Bacher 2015-09-22 11:50:27 UTC
==22793== Invalid read of size 4
==22793==    at 0x4E1EAE2: g_type_check_instance_is_a (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4937830: e_source_get_display_name (in /usr/lib/libedataserver-1.2.so.20.0.0)
==22793==    by 0x9134625: ubuntu_online_accounts_get_access_token (in /usr/lib/evolution-data-server/registry-modules/module-ubuntu-online-accounts.so)
==22793==    by 0x4895ED1: e_oauth2_support_get_access_token (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x9133210: ubuntu_online_accounts_get_access_token_sync (in /usr/lib/evolution-data-server/registry-modules/module-ubuntu-online-accounts.so)
==22793==    by 0x4895D3D: e_oauth2_support_get_access_token_sync (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x4899A6B: server_side_source_get_oauth2_access_token_sync (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x493B6AF: e_source_get_oauth2_access_token_sync (in /usr/lib/libedataserver-1.2.so.20.0.0)
==22793==    by 0xAEB0E99: e_webdav_discover_sources_sync (in /usr/lib/evolution-data-server/registry-modules/module-google-backend.so)
==22793==    by 0xAEAD5AD: google_backend_authenticate_sync (in /usr/lib/evolution-data-server/registry-modules/module-google-backend.so)
==22793==    by 0x488DBF2: backend_source_authenticate_thread (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x4EB9299: g_thread_proxy (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4F781A9: start_thread (pthread_create.c:333)
==22793==    by 0x5078FDD: clone (clone.S:122)
==22793==  Address 0x7cc4310 is 200 bytes inside a block of size 224 free'd
==22793==    at 0x482D358: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==22793==    by 0x4E9721F: g_free (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4EAF102: g_slice_free1 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E1DE86: g_type_free_instance (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4DFF4DC: g_object_unref (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4941D7C: async_context_free (in /usr/lib/libedataserver-1.2.so.20.0.0)
==22793==    by 0x4CA8259: g_task_finalize (in /usr/lib/i386-linux-gnu/libgio-2.0.so.0.4507.0)
==22793==    by 0x4DFF4D4: g_object_unref (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4E8E4C7: g_source_callback_unref (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E8EF29: g_source_destroy_internal (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E91C86: g_main_context_dispatch (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E91FD8: g_main_context_iterate.isra.29 (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x4E92388: g_main_loop_run (in /lib/i386-linux-gnu/libglib-2.0.so.0.4507.0)
==22793==    by 0x48951B2: dbus_server_run_server (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x5F32D11: ffi_call_SYSV (in /usr/lib/i386-linux-gnu/libffi.so.6.0.4)
==22793==    by 0x5F3298B: ffi_call (in /usr/lib/i386-linux-gnu/libffi.so.6.0.4)
==22793==    by 0x4DFB642: g_cclosure_marshal_generic_va (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4DF92A1: g_type_class_meta_marshalv (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4DFAC8E: _g_closure_invoke_va (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4E15078: g_signal_emit_valist (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x4E15644: g_signal_emit (in /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.4507.0)
==22793==    by 0x48954CA: e_dbus_server_run (in /usr/lib/libebackend-1.2.so.10.0.0)
==22793==    by 0x10B900: main (in /usr/lib/evolution/evolution-source-registry)
==22793==
Comment 4 Milan Crha 2015-09-23 12:26:41 UTC
Thanks for a bug report. I see these two too, when I select the Google Book configured in Ubuntu Online Accounts, though it doesn't seem to have any impact on the book as such, I see my contacts there.

(In reply to Sebastien Bacher from comment #1)
> file uoa-utils.c: line 628 (e_source_get_ag_service_type): should not be
> reached
> 
> ubuntu_online_accounts_ref_account_service: assertion 'service_type != NULL'
> failed

I see some of the other warnings you reported above also when using GNOME Online Accounts (GOA), though I see too many other when only running the evolution-source-registry under valgrind, with nothing else (evolution-related) running and no sources configured, that I think it's some oddity on the Ubuntu side, also because the same steps being done in Fedora do not produce any single valgrind warning (using GOA).

Could it be anything with memory alignment, with which (if I recall correctly) can have valgrind certain issues?
Comment 5 Milan Crha 2015-09-23 13:16:32 UTC
Looking into 3.18.0 sources of the evolution-data-server:
> g_string_free: assertion 'string != NULL' failed

This one is a leftover, from e-signon-session-password.c:279

> file uoa-utils.c: line 628 (e_source_get_ag_service_type): should not be
> reached

This one is because the e_source_get_ag_service_type() is called for the collection source, which doesn't contain any checked extensions. 

> ubuntu_online_accounts_ref_account_service: assertion 'service_type != NULL'
> failed

This one is caused by the previous one.

I fixed all two (three) with:
Created commit 1054485 in eds master (3.19.1+)
Created commit f1081b2 in eds gnome-3-18 (3.18.1+)
Comment 6 Sebastien Bacher 2015-09-23 13:51:15 UTC
Thanks. Did you need any more info from me? Unsure about the extra warnings you mentioned, I don't see those. Note that also my calendar events don't show in the unity indicator, unsure if that's a configuration problem. 

Evolution states "Failed to connect ... Cannot find a corresponding account service in the accounts database from which to obtain an access token..."
Comment 7 Milan Crha 2015-09-23 14:24:15 UTC
> Evolution states "Failed to connect ... Cannot find a corresponding account
> service in the accounts database from which to obtain an access token..."

Right, the above is fixed with the commit 1054485, it might be easily backported to 3.16.5 too. Also note of bug #755412.

I also fixed one possible runtime warning, even harmless, with commit a44a678.

Otherwise I do not know how to reproduce the issue from comment #0, I do not see any problem with it when I added some more debugging around. By the way, I'm testing this all with git master, which is much like 3.18.0 in this state, thus "the next stable from what you have".
Comment 8 Sebastien Bacher 2015-09-23 14:31:35 UTC
Thanks, I just backported the commits from trunk (the one for the warning there and the patch from Mardy) and that fixed my calendar, I guess the issue was the oauth token refresh
Comment 9 Milan Crha 2015-09-23 16:37:18 UTC
Good news, I managed to reproduce the crash (valgrind logs about it). There is one incorrect (leftover/overlooked) g_object_unref() on an ESource. It's hidden, because e_webdav_discover() indirectly leaks a reference on the same ESource, thus if you are quick enough, you can make the reference decrease only, not increase. It's basically the way I reproduced it, I quickly enabled & disabled the EDS Contacts part in Ubuntu Online Accounts dialog, repeatedly, which finally made the ESource die.
Comment 10 Milan Crha 2015-09-23 17:07:42 UTC
The below commits are the fix for the incorrect ESource unref. I also
committed [1] for the reference leak from an e-webdav-discover code.

Created commit 53bbf8d in eds master (3.19.1+)
Created commit 1765be5 in eds gnome-3-18 (3.18.1+)

[1] https://git.gnome.org/browse/evolution-data-server/commit/?id=aebcdc9