Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 310941 Details for
Bug 453989
[RHEL4/Evo28] e-d-s crash in e_cal_backend_sync_dispose
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch based on upstream code
e-data-cal-factory.patch (text/plain), 5.31 KB, created by
ritz
on 2008-07-03 17:34:48 UTC
(
hide
)
Description:
patch based on upstream code
Filename:
MIME Type:
Creator:
ritz
Created:
2008-07-03 17:34:48 UTC
Size:
5.31 KB
patch
obsolete
>--- /root/e-data-cal-factory.c 2008-07-01 22:55:54.000000000 +0530 >+++ calendar/libedata-cal/e-data-cal-factory.c 2008-07-01 23:19:51.000000000 +0530 >@@ -42,6 +42,9 @@ > > /* Hash table from GnomeVFSURI structures to CalBackend objects */ > GHashTable *backends; >+ /* mutex to access backends hash table */ >+ GMutex *backends_mutex; >+ > > /* OAFIID of the factory */ > char *iid; >@@ -49,8 +52,7 @@ > /* Whether we have been registered with OAF yet */ > guint registered : 1; > >- int mode; >- >+ int mode; > }; > > /* Signal IDs */ >@@ -102,6 +104,7 @@ > ECalBackend *ret_backend; > const char *uristr; > char *uri; >+ gboolean last_calendar; > > fprintf (stderr, "backend_last_client_gone_cb() called!\n"); > >@@ -114,6 +117,8 @@ > g_assert (uristr != NULL); > uri = g_strdup_printf("%s:%d", uristr, (int)e_cal_backend_get_kind(backend)); > >+ g_mutex_lock (priv->backends_mutex); >+ > ret_backend = g_hash_table_lookup (factory->priv->backends, uri); > g_assert (ret_backend != NULL); > g_assert (ret_backend == backend); >@@ -124,8 +129,12 @@ > g_signal_handlers_disconnect_matched (backend, G_SIGNAL_MATCH_DATA, > 0, 0, NULL, NULL, data); > >+ last_calendar = (g_hash_table_size (priv->backends) == 0); >+ >+ g_mutex_unlock (priv->backends_mutex); >+ > /* Notify upstream if there are no more backends */ >- if (g_hash_table_size (priv->backends) == 0) >+ if (last_calendar) > g_signal_emit (G_OBJECT (factory), signals[LAST_CALENDAR_GONE], 0); > } > >@@ -138,13 +147,11 @@ > const GNOME_Evolution_Calendar_CalListener listener, > CORBA_Environment *ev) > { >- GNOME_Evolution_Calendar_Cal ret_cal = NULL; >+ GNOME_Evolution_Calendar_Cal ret_cal = CORBA_OBJECT_NIL; > EDataCalFactory *factory; > EDataCalFactoryPrivate *priv; > EDataCal *cal = CORBA_OBJECT_NIL; > ECalBackend *backend; >- CORBA_Environment ev2; >- GNOME_Evolution_Calendar_CalListener listener_copy; > ECalBackendFactory *backend_factory; > ESource *source; > char *str_uri; >@@ -188,19 +195,9 @@ > bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CalFactory_UnsupportedMethod); > goto cleanup; > } >- >- /* Duplicate the listener object */ >- CORBA_exception_init (&ev2); >- listener_copy = CORBA_Object_duplicate (listener, &ev2); >- >- if (BONOBO_EX (&ev2)) { >- g_warning (G_STRLOC ": could not duplicate the listener"); >- bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CalFactory_NilListener); >- CORBA_exception_free (&ev2); >- goto cleanup; >- } >- CORBA_exception_free (&ev2); > >+ g_mutex_lock (priv->backends_mutex); >+ > /* Look for an existing backend */ > backend = g_hash_table_lookup (factory->priv->backends, uri_type_string); > if (!backend) { >@@ -223,19 +220,22 @@ > > /* Create the corba calendar */ > cal = e_data_cal_new (backend, listener); >- printf ("cal = %p\n", cal); >- if (!cal) { >+ if (cal) { >+ /* Let the backend know about its clients corba clients */ >+ e_cal_backend_add_client (backend, cal); >+ e_cal_backend_set_mode (backend, priv->mode); >+ ret_cal = bonobo_object_corba_objref (BONOBO_OBJECT (cal)); >+ } else { > g_warning (G_STRLOC ": could not create the corba calendar"); > bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_CalFactory_UnsupportedMethod); >- goto cleanup; > } > >- /* Let the backend know about its clients corba clients */ >- e_cal_backend_add_client (backend, cal); >- e_cal_backend_set_mode (backend, priv->mode); >- >- ret_cal = CORBA_Object_duplicate (BONOBO_OBJREF (cal), ev); > cleanup: >+ /* The reason why the lock is held for such a long time is that there is >+ a subtle race where e_cal_backend_add_client() can be called just >+ before e_cal_backend_finalize() is called from the >+ backend_last_client_gone_cb(), for details see bug 506457. */ >+ g_mutex_unlock (priv->backends_mutex); > e_uri_free (uri); > g_free (uri_type_string); > g_object_unref (source); >@@ -284,6 +284,7 @@ > > /* Should we assert that there are no more backends? */ > g_hash_table_destroy (priv->backends); >+ g_mutex_free (priv->backends_mutex); > priv->backends = NULL; > > if (priv->registered) { >@@ -342,11 +343,12 @@ > void > e_data_cal_factory_set_backend_mode (EDataCalFactory *factory, int mode) > { >- EDataCalFactoryPrivate *priv = factory->priv; >- >+ EDataCalFactoryPrivate *priv = factory->priv; > > priv->mode = mode; >+ g_mutex_lock (priv->backends_mutex); > g_hash_table_foreach (priv->backends, set_backend_online_status, GINT_TO_POINTER (priv->mode)); >+ g_mutex_unlock (priv->backends_mutex); > } > > >@@ -364,6 +366,7 @@ > priv->backends = g_hash_table_new_full (g_str_hash, g_str_equal, > (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref); > priv->registered = FALSE; >+ priv->backends_mutex = g_mutex_new (); > } > > BONOBO_TYPE_FUNC_FULL (EDataCalFactory, >@@ -510,11 +513,16 @@ > e_data_cal_factory_get_n_backends (EDataCalFactory *factory) > { > EDataCalFactoryPrivate *priv; >+ int sz; > > g_return_val_if_fail (E_IS_DATA_CAL_FACTORY (factory), 0); > > priv = factory->priv; >- return g_hash_table_size (priv->backends); >+ g_mutex_lock (priv->backends_mutex); >+ sz = g_hash_table_size (priv->backends); >+ g_mutex_unlock (priv->backends_mutex); >+ >+ return sz; > } > > /* Frees a uri/backend pair from the backends hash table */ >@@ -545,5 +553,7 @@ > g_message ("Active PCS backends"); > > priv = factory->priv; >+ g_mutex_lock (priv->backends_mutex); > g_hash_table_foreach (priv->backends, dump_backend, NULL); >+ g_mutex_unlock (priv->backends_mutex); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 453989
: 310941