RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1172143 - Use-after-free in source_registry_source_notify_enabled_idle_cb()
Summary: Use-after-free in source_registry_source_notify_enabled_idle_cb()
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: evolution-data-server
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Matthew Barnes
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On: 1174414
Blocks: 1173497
TreeView+ depends on / blocked
 
Reported: 2014-12-09 13:19 UTC by Patrik Martinsson
Modified: 2015-11-19 07:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
This had been fixed by the rebase. I wouldn't mention this in the Doc Text.
Clone Of:
: 1173497 (view as bug list)
Environment:
Last Closed: 2015-11-19 07:56:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The "whole gdb trace" (24.60 KB, text/plain)
2014-12-09 14:53 UTC, Patrik Martinsson
no flags Details
New stacktrace with *correct* evolution-ews-debuginfo (21.94 KB, text/plain)
2014-12-09 20:12 UTC, Patrik Martinsson
no flags Details
First valgrind, (68.37 KB, text/plain)
2014-12-09 20:12 UTC, Patrik Martinsson
no flags Details
Second valgrind (69.95 KB, text/plain)
2014-12-09 20:13 UTC, Patrik Martinsson
no flags Details
New stacktrace with bt's in place (27.40 KB, text/plain)
2014-12-10 08:23 UTC, Patrik Martinsson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 695754 0 None None None Never
Red Hat Product Errata RHBA-2015:2226 0 normal SHIPPED_LIVE evolution bug fix and enhancement update 2015-11-19 08:37:43 UTC

Description Patrik Martinsson 2014-12-09 13:19:58 UTC
Description of problem:
Evolution crashes when configured the first time using the "assistant". 

Version-Release number of selected component (if applicable):
evolution-3.8.5-22.el7_0.1.x86_64

How reproducible:
Everytime 

Steps to Reproduce:
1. Create a new user 
2. Log in 
3. Start Evolution 
4. Finish the guide using "Exchange webservices" as provider, 
5. Evolution crashes 
6. Start Evolution
7. Continue business as usual (Evolution now works)

Actual results:
Evolution crashes, 

Expected results:
No crash. 

Additional info:

This is the output when running Evolution from the command-line, 

(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
(evolution:30530): Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
WARNING: gnome-keyring:: C_Initialize called twice for same process
Working around libsoup bug with redirect
Working around libsoup bug with redirect
(evolution:30530): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed
(evolution:30530): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'
(evolution:30530): GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
(evolution:30530): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
**
GLib-GObject:ERROR:gobject.c:4127:g_weak_ref_set: assertion failed: (weak_locations != NULL)

Comment 2 Milan Crha 2014-12-09 14:30:55 UTC
Thanks for a bug report. I tried to reproduce the crash, but no luck so far. I:
a) kill all evolution related processes (ps ax | grep evolution), except of
   the evolution-calendar-factory;
b) delete everything under:
   ~/.local/share/evolution
   ~/.cache/evolution
   ~/.config/evolution
   Beware, it removes locally stored data, thus be cautious, if you'll repeat
   my steps (I didn't have anything to lose there).
c) finally kill evolution-calendar-factory (that's because gnome-shell
   restarts it when it is closed/killed, thus few seconds later another
   instance of it is running again)
d) run evolution
e) fill EWS account details, click Fetch URL button, then left everything in
   defaults and click Finish at the end of the wizard.

Evolution run properly and I could see my EWS account details. I would expect that Abrt catch the crash and will provide a backtrace for it, thus there'll be shown where it crashed and what can be eventually done, but you do not seem to have it.

Could you try to reproduce (you can delete only the ~/.config/evolution folder in b) too), but this time under gdb and with debuginfo packages for at least evolution-data-server, evolution and evolution-ews having installed, of the same version as their binary packages are, please?

The gdb command can look like this:
   $ gdb evolution --ex r --ex "t a a bt" --ex q
which runs the evolution and if it stops, either correctly or incorrectly (with a crash) it'll print backtraces for each running thread. Please check the output for any private information, like passwords, email address, server addresses,... I usually search for "pass" at least (quotes for clarity only), before sharing it here. It's also enough to get the gdb output from the last
> Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed
the output above this critical runtime warnings is not useful.

Comment 3 Patrik Martinsson 2014-12-09 14:50:43 UTC
Hi Milan, 

Thanks for quick answer. 

Installing the debugpackages (from centos though, but same version), resulted in the following backtrace, did exactly as the steps you described. 

Output below the last, "Gtk-CRITICAL **: gtk_entry_set_text: assertion `text != NULL' failed" 

== 

(evolution:4134): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(evolution:4134): GLib-GObject-WARNING **: instance of invalid non-instantiatable type `(null)'

(evolution:4134): GLib-GObject-CRITICAL **: g_signal_emit_valist: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(evolution:4134): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed
**
GLib-GObject:ERROR:gobject.c:4127:g_weak_ref_set: assertion failed: (weak_locations != NULL)

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffaeec3700 (LWP 4224)]
0x00007fffee1a95c9 in raise () from /lib64/libc.so.6

Thread 41 (Thread 0x7fff8d7ef700 (LWP 4251)):
#0  0x00007fffee25fa4d in poll () from /lib64/libc.so.6
#1  0x00007fffee57ddd4 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#2  0x00007fffee57e25a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#3  0x00007fffd175311e in e_ews_soup_thread () from /usr/lib64/evolution-data-server/libeews-1.2.so.0
#4  0x00007fffee5a2745 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007ffff3c80df3 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fffee26a01d in clone () from /lib64/libc.so.6

Thread 39 (Thread 0x7fff95601700 (LWP 4231)):
#0  0x00007ffff3c84705 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ffff1a8d26b in WebCore::IconDatabase::syncThreadMainLoop() () from /lib64/libwebkitgtk-3.0.so.0
#2  0x00007ffff1a8d46b in WebCore::IconDatabase::iconDatabaseSyncThread() () from /lib64/libwebkitgtk-3.0.so.0
#3  0x00007ffff02efdb6 in WTF::wtfThreadEntryPoint(void*) () from /lib64/libjavascriptcoregtk-3.0.so.0
#4  0x00007ffff3c80df3 in start_thread () from /lib64/libpthread.so.0
#5  0x00007fffee26a01d in clone () from /lib64/libc.so.6

Thread 38 (Thread 0x7fff95e02700 (LWP 4230)):
#0  0x00007ffff3c84705 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007ffff02d9ce6 in WTF::TCMalloc_PageHeap::scavengerThread() () from /lib64/libjavascriptcoregtk-3.0.so.0
#2  0x00007ffff02d9d19 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /lib64/libjavascriptcoregtk-3.0.so.0
#3  0x00007ffff3c80df3 in start_thread () from /lib64/libpthread.so.0
#4  0x00007fffee26a01d in clone () from /lib64/libc.so.6

Thread 37 (Thread 0x7fff96806700 (LWP 4228)):
#0  0x00007ffff3c84ab2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007fffee5be395 in g_cond_wait_until () from /lib64/libglib-2.0.so.0
#2  0x00007fffee553bd1 in g_async_queue_pop_intern_unlocked () from /lib64/libglib-2.0.so.0
#3  0x00007fffee55418b in g_async_queue_timeout_pop () from /lib64/libglib-2.0.so.0
#4  0x00007fffee5a31c6 in g_thread_pool_thread_proxy () from /lib64/libglib-2.0.so.0
#5  0x00007fffee5a2745 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#6  0x00007ffff3c80df3 in start_thread () from /lib64/libpthread.so.0
#7  0x00007fffee26a01d in clone () from /lib64/libc.so.6

Thread 35 (Thread 0x7fff97007700 (LWP 4226)):
#0  0x00007fffee25fa4d in poll () from /lib64/libc.so.6
#1  0x00007fffee57ddd4 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#2  0x00007fffee57e25a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#3  0x00007ffff543b34d in async_closure_wait (closure=0x1456820) at camel-service.c:144
#4  camel_service_connect_sync (service=service@entry=0x12ae2a0, cancellable=cancellable@entry=0x16981e0, error=error@entry=0x7fff97006b40) at camel-service.c:1644
#5  0x00007ffff544a220 in store_maybe_connect_sync (error=0x7fff97006b40, cancellable=0x16981e0, store=0x12ae2a0) at camel-store.c:306
#6  camel_store_get_folder_info_sync (store=0x12ae2a0, top=top@entry=0x0, flags=flags@entry=(CAMEL_STORE_FOLDER_INFO_FAST | CAMEL_STORE_FOLDER_INFO_RECURSIVE | CAMEL_STORE_FOLDER_INFO_SUBSCRIBED), 
    cancellable=cancellable@entry=0x16981e0, error=error@entry=0x7fff97006b40) at camel-store.c:2137
#7  0x00007ffff544a522 in store_get_folder_info_thread (simple=0x7fffc418b190, object=0x12ae2a0, cancellable=0x16981e0) at camel-store.c:568
#8  0x00007fffeeb1983f in run_in_thread () from /lib64/libgio-2.0.so.0
#9  0x00007fffeeb07406 in io_job_thread () from /lib64/libgio-2.0.so.0
#10 0x00007fffeeb268c5 in g_task_thread_pool_thread () from /lib64/libgio-2.0.so.0


There's also a suggestion to install *a lot* of debuginfo-packages. 
Is the information above enough ? I have no problem recreating the issue it seems. 

Best regards, 
Patrik Martinsson
Sweden

Comment 4 Patrik Martinsson 2014-12-09 14:53:15 UTC
Created attachment 966303 [details]
The "whole gdb trace"

Here's the "whole gdb trace" instead.

Comment 5 Milan Crha 2014-12-09 17:27:26 UTC
(In reply to Patrik from comment #3)
> There's also a suggestion to install *a lot* of debuginfo-packages.

Thanks for the update. It's true, but I fortunately do not care of all of them, only of some.

> Is the information above enough ?

The backtrace shows debuginfo for evolution-data-server, but not for
evolution-ews. Please install it too.

> I have no problem recreating the issue it seems.

You are lucky (from my point of view). I guess there happened some memory corruption, some code could write somewhere where it should not, or it freed some memory incorrectly or any other kind of a software memory corruption. it can be just due to certain ordering of the threads/operations. I would try to reproduce this under valgrind, which can sometimes detect such memory issues and report about them, instead of crashing. Could you try that, please? The valgrind command may look like this:
   $ G_SLICE=always-malloc valgrind --num-callers=20 evolution &>log.txt
As I mentione above, it's possible that evolution will not crash, but the resulting log will still show the memory issue. I guess the issue is somewhere before:
> (evolution:4134): GLib-GObject-CRITICAL **: g_object_ref: assertion
> `G_IS_OBJECT (object)' failed

The crashing thread from your backtrace is this one:

Thread 33 (Thread 0x7fffaeec3700 (LWP 4224)):
#0  0x00007fffee1a95c9 in raise () from /lib64/libc.so.6
#1  0x00007fffee1aacd8 in abort () from /lib64/libc.so.6
#2  0x00007fffee5a2186 in g_assertion_message () from /lib64/libglib-2.0.so.0
#3  0x00007fffee5a21e4 in g_assertion_message_expr () from /lib64/libglib-2.0.so.0
#4  0x00007fffee878116 in g_weak_ref_set () from /lib64/libgobject-2.0.so.0
#5  0x00007ffff574bd7b in source_closure_free (closure=0x7fffa003a470) at e-source-registry.c:269
#6  0x00007fffee57aa08 in g_source_callback_unref () from /lib64/libglib-2.0.so.0
#7  0x00007fffee57af57 in g_source_destroy_internal () from /lib64/libglib-2.0.so.0
#8  0x00007fffee57db10 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#9  0x00007fffee57de48 in g_main_context_iterate.isra.22 () from /lib64/libglib-2.0.so.0
#10 0x00007fffee57e25a in g_main_loop_run () from /lib64/libglib-2.0.so.0
#11 0x00007ffff574ed1d in e_source_registry_authenticate_sync (registry=registry@entry=0x669400, source=source@entry=0x7fffc8065130, auth=auth@entry=0x14814c0, cancellable=cancellable@entry=0x779f00, 
    error=error@entry=0x7fffaeec2b60) at e-source-registry.c:2086
#12 0x00007fffd1318608 in mail_session_authenticate_sync (session=<optimized out>, service=0x12ae2a0, mechanism=<optimized out>, cancellable=0x779f00, error=0x7fffaeec2b60) at e-mail-session.c:1603
#13 0x00007ffff543e874 in camel_session_authenticate_sync (session=0x6802a0, service=0x12ae2a0, mechanism=0x7fffa40059c0 "PLAIN", cancellable=0x779f00, error=0x7fffaeec2b60) at camel-session.c:1832
#14 0x00007fffd1999c32 in ews_connect_sync () from /usr/lib64/evolution-data-server/camel-providers/libcamelews.so
#15 0x00007ffff5439483 in service_connect_thread (simple=0x7fffc4068670, object=0x12ae2a0, cancellable=0x779f00) at camel-service.c:773
#16 0x00007fffeeb1983f in run_in_thread () from /lib64/libgio-2.0.so.0
#17 0x00007fffeeb07406 in io_job_thread () from /lib64/libgio-2.0.so.0
#18 0x00007fffeeb268c5 in g_task_thread_pool_thread () from /lib64/libgio-2.0.so.0
#19 0x00007fffee5a30fc in g_thread_pool_thread_proxy () from /lib64/libglib-2.0.so.0
#20 0x00007fffee5a2745 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#21 0x00007ffff3c80df3 in start_thread () from /lib64/libpthread.so.0
#22 0x00007fffee26a01d in clone () from /lib64/libc.so.6

Comment 6 Patrik Martinsson 2014-12-09 20:12:07 UTC
Created attachment 966447 [details]
New stacktrace with *correct* evolution-ews-debuginfo

Comment 7 Patrik Martinsson 2014-12-09 20:12:33 UTC
Created attachment 966449 [details]
First valgrind,

No crash

Comment 8 Patrik Martinsson 2014-12-09 20:13:01 UTC
Created attachment 966450 [details]
Second valgrind

No crash

Comment 9 Patrik Martinsson 2014-12-09 20:13:44 UTC
I was not able to reproduce the crash when running it under valgrind, but hopefully you got enough info. 

Let me know if you need more info.

Comment 10 Milan Crha 2014-12-10 06:41:17 UTC
Thanks for the update. The valgrind really doesn't log anything related. it also shows the two messages:
> Working around libsoup bug with redirect
> Working around libsoup bug with redirect

but then the mcritical warning is missing
> (evolution:30530): GLib-GObject-CRITICAL **: g_object_ref: assertion
> `G_IS_OBJECT (object)' failed

I suppose from that the issue is related to certain timing and thread interleaving. As valgrind made the calls take longer, due to all the memory checking, then it prevented the issue.

Could you try to catch the lace of the above critical warning, please? I would do it myself, but I do not hit this thread interleaving issue myself. You can do that under gdb with this command:

   $ gdb evolution --ex r --ex "b g_logv" --ex c --ex bt --ex c

which will run evolution. When you get the new account wizard opened and some values filled for the EWS account, press Ctrl+C in the gdb's terminal. That will install a breakpoint and continue in the run. Then reproduce the issue in Evolution. It's possible that the g_logv function will be called multiple times, within unrelated code, which will also stop gdb (and freeze evolution, which is expected), then repeat the gdb commands "bt" "c" to print a backtrace of the g_logv call place and continue in the run. Once it's over quit gdb with a "q" command.

Comment 11 Patrik Martinsson 2014-12-10 08:23:08 UTC
Created attachment 966700 [details]
New stacktrace with bt's in place

Made evolution crash with gdb and the commands suggested.

Comment 12 Milan Crha 2014-12-10 15:31:49 UTC
Thanks a lot for the backtraces. It shows nicely when the issue happend. I'll try to investigate why and return back to you when I have more information.

Comment 13 Milan Crha 2014-12-12 08:05:33 UTC
I can reproduce this crash too, with a bit of cheating in the code (pausing event delivery). The problem is that the evolution-ews is creating its own instance of an ESourceRegistry, at the place shown in the below backtrace. This ESourceRegistry has scheduled the source_registry_source_notify_enabled_idle_cb() while the 'registry' object is disposing, which later leads to the crash when using already freed data in the callback. I'm checking how to fix this in the most sane way.

#6  0x00007ffff52d62f3 in e_source_registry_new_sync (cancellable=0x0, error=0x0) at e-source-registry.c:1677
#7  0x00007fffd27c529b in ews_store_maybe_update_sent_and_drafts (ews_store=0x13ebf30, ews_folders=0xc1d2b0 = {...}) at camel-ews-store.c:904
#8  0x00007fffd27c5d16 in ews_authenticate_sync (service=0x13ebf30, mechanism=0x7fff98008190 "NTLM", cancellable=0x1488c90, error=0x7fffad325920) at camel-ews-store.c:1124
#9  0x00007ffff489476e in camel_service_authenticate_sync (service=0x13ebf30, mechanism=0x7fff98008190 "NTLM", cancellable=0x1488c90, error=0x7fffad325920) at camel-service.c:2017
#10 0x00007fffd1ef1ab0 in mail_authenticator_try_password_sync (auth=0x14a7540, password=0x7fffc8404e80, cancellable=0x1488c90, error=0x7fffad325920) at e-mail-authenticator.c:165
#11 0x00007ffff52c750f in e_source_authenticator_try_password_sync (auth=0x14a7540, password=0x7fffc8404e80, cancellable=0x1488c90, error=0x7fffad325920) at e-source-authenticator.c:418
#12 0x00007ffff52d6747 in source_registry_authenticate_authenticate_cb (dbus_auth=0x13d5960,

Comment 14 Milan Crha 2014-12-12 10:37:11 UTC
Corresponding upstream fix:
https://git.gnome.org/browse/evolution-data-server/commit/?id=c77dec7

Comment 19 errata-xmlrpc 2015-11-19 07:56:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2226.html


Note You need to log in before you can comment on or make changes to this bug.