Comment # 20 on bug 59571 from
The current openismus-work-3-8 branch has code which reacts to locale changes:

commit 2d287ca7d2ab45af28deb1847b9fdcad0626ec71
Author: Tristan Van Berkom <tristanvb@openismus.com>
Date:   Thu May 23 15:24:09 2013 +0900

    EDataBook: Watch the system bus for locale notifications

    When org.freedesktop.locale1 is available, listen to changes in
    the LC_COLLATE locale and configure backends with locale changes
    using e_book_backend_set_locale(), notify property changes via
    the locale property on the addressbook D-Bus API.

    Also, load the backend's initially set locale as the locale property
    value until the org.freedesktop.locale1 D-Bus interface notifies
    us of a locale change on the system bus.

However, it is (partially?) broken. From a test run involving a SyncEvolution
test:

==3285== Command:
/data/runtests/install/testing-amd64/evo-src-master/libexec//evolution-addressbook-factory
--keep-r
unning
==3285== Parent PID: 3281
==3285== 
==3285== Invalid read of size 8
==3285==    at 0x4E69054: data_book_locale_changed (e-data-book.c:2046)
==3285==    by 0x4E691F5: data_book_localed_ready (e-data-book.c:2077)
==3285==    by 0x90ED8D6: g_simple_async_result_complete
(gsimpleasyncresult.c:777)
==3285==    by 0x90ED9D8: complete_in_idle_cb (gsimpleasyncresult.c:789)
==3285==    by 0x966D3D4: g_main_context_dispatch (gmain.c:3054)
==3285==    by 0x966D717: g_main_context_iterate.isra.22 (gmain.c:3701)
==3285==    by 0x966DB89: g_main_loop_run (gmain.c:3895)
==3285==    by 0x52E051C: dbus_server_run_server (e-dbus-server.c:222)
==3285==    by 0x10CCB7BB: ffi_call_unix64 (in
/usr/lib/x86_64-linux-gnu/libffi.so.5.0.10)
==3285==    by 0x10CCB236: ffi_call (in
/usr/lib/x86_64-linux-gnu/libffi.so.5.0.10)
==3285==    by 0x93E60BA: g_cclosure_marshal_generic_va (gclosure.c:1550)
==3285==    by 0x93E53E6: _g_closure_invoke_va (gclosure.c:840)
==3285==    by 0x93FDD45: g_signal_emit_valist (gsignal.c:3234)
==3285==    by 0x93FE921: g_signal_emit (gsignal.c:3384)
==3285==    by 0x52E07B9: e_dbus_server_run (e-dbus-server.c:414)
==3285==    by 0x400E54: main (evolution-addressbook-factory.c:132)
==3285==  Address 0x199b0be8 is 24 bytes inside a block of size 176 free'd
==3285==    at 0x4C2A68C: free (vg_replace_malloc.c:446)
==3285==    by 0x94050C4: g_type_free_instance (gtype.c:1962)
==3285==    by 0x4E69488: op_unref (e-data-book.c:374)
==3285==    by 0x4E6CB8F: operation_thread (e-data-book.c:754)
==3285==    by 0x9691881: g_thread_pool_thread_proxy (gthreadpool.c:309)
==3285==    by 0x9691044: g_thread_proxy (gthread.c:798)
==3285==    by 0x9952E0D: start_thread (pthread_create.c:311)
==3285==    by 0x9C4F9EC: clone (clone.S:113)
==3285== 
{
   <insert_a_suppression_name_here>
   Memcheck:Addr8
   fun:data_book_locale_changed
   fun:data_book_localed_ready
   fun:g_simple_async_result_complete
   fun:complete_in_idle_cb
   fun:g_main_context_dispatch
   fun:g_main_context_iterate.isra.22
   fun:g_main_loop_run
   fun:dbus_server_run_server
   fun:ffi_call_unix64
   fun:ffi_call
   fun:g_cclosure_marshal_generic_va
   fun:_g_closure_invoke_va
   fun:g_signal_emit_valist
   fun:g_signal_emit
   fun:e_dbus_server_run
   fun:main
}
==3285== Invalid read of size 8
==3285==    at 0x4E6905B: data_book_locale_changed (e-data-book.c:2046)
==3285==    by 0x4E691F5: data_book_localed_ready (e-data-book.c:2077)
==3285==    by 0x90ED8D6: g_simple_async_result_complete
(gsimpleasyncresult.c:777)
==3285==    by 0x90ED9D8: complete_in_idle_cb (gsimpleasyncresult.c:789)
==3285==    by 0x966D3D4: g_main_context_dispatch (gmain.c:3054)
==3285==    by 0x966D717: g_main_context_iterate.isra.22 (gmain.c:3701)
==3285==    by 0x966DB89: g_main_loop_run (gmain.c:3895)
==3285==    by 0x52E051C: dbus_server_run_server (e-dbus-server.c:222)
==3285==    by 0x10CCB7BB: ffi_call_unix64 (in
/usr/lib/x86_64-linux-gnu/libffi.so.5.0.10)
==3285==    by 0x10CCB236: ffi_call (in
/usr/lib/x86_64-linux-gnu/libffi.so.5.0.10)
==3285==    by 0x93E60BA: g_cclosure_marshal_generic_va (gclosure.c:1550)
==3285==    by 0x93E53E6: _g_closure_invoke_va (gclosure.c:840)
==3285==    by 0x93FDD45: g_signal_emit_valist (gsignal.c:3234)
==3285==    by 0x93FE921: g_signal_emit (gsignal.c:3384)
==3285==    by 0x52E07B9: e_dbus_server_run (e-dbus-server.c:414)
==3285==    by 0x400E54: main (evolution-addressbook-factory.c:132)
==3285==  Address 0x8 is not stack'd, malloc'd or (recently) free'd
==3285== 
{
   <insert_a_suppression_name_here>
   Memcheck:Addr8
   fun:data_book_locale_changed
   fun:data_book_localed_ready
   fun:g_simple_async_result_complete
   fun:complete_in_idle_cb
   fun:g_main_context_dispatch
   fun:g_main_context_iterate.isra.22
   fun:g_main_loop_run
   fun:dbus_server_run_server
   fun:ffi_call_unix64
   fun:ffi_call
   fun:g_cclosure_marshal_generic_va
   fun:_g_closure_invoke_va
   fun:g_signal_emit_valist
   fun:g_signal_emit
   fun:e_dbus_server_run
   fun:main
}
==3285== 
==3285== Process terminating with default action of signal 11 (SIGSEGV)
==3285==  Access not within mapped region at address 0x8
==3285==    at 0x4E6905B: data_book_locale_changed (e-data-book.c:2046)
==3285==    by 0x4E691F5: data_book_localed_ready (e-data-book.c:2077)
==3285==    by 0x90ED8D6: g_simple_async_result_complete
(gsimpleasyncresult.c:777)
==3285==    by 0x90ED9D8: complete_in_idle_cb (gsimpleasyncresult.c:789)
==3285==    by 0x966D3D4: g_main_context_dispatch (gmain.c:3054)
==3285==    by 0x966D717: g_main_context_iterate.isra.22 (gmain.c:3701)
==3285==    by 0x966DB89: g_main_loop_run (gmain.c:3895)
==3285==    by 0x52E051C: dbus_server_run_server (e-dbus-server.c:222)
==3285==    by 0x10CCB7BB: ffi_call_unix64 (in
/usr/lib/x86_64-linux-gnu/libffi.so.5.0.10)
==3285==    by 0x10CCB236: ffi_call (in
/usr/lib/x86_64-linux-gnu/libffi.so.5.0.10)
==3285==    by 0x93E60BA: g_cclosure_marshal_generic_va (gclosure.c:1550)
==3285==    by 0x93E53E6: _g_closure_invoke_va (gclosure.c:840)
==3285==    by 0x93FDD45: g_signal_emit_valist (gsignal.c:3234)
==3285==    by 0x93FE921: g_signal_emit (gsignal.c:3384)
==3285==    by 0x52E07B9: e_dbus_server_run (e-dbus-server.c:414)
==3285==    by 0x400E54: main (evolution-addressbook-factory.c:132)

This happens with the TestContact.testLocaledPhone test from SyncEvolution,
modified to rely on EDS:

diff --git a/src/dbus/server/pim/testpim.py b/src/dbus/server/pim/testpim.py
index a2e1f71..2315bcd 100755
--- a/src/dbus/server/pim/testpim.py
+++ b/src/dbus/server/pim/testpim.py
@@ -58,7 +58,7 @@ if testFolder not in sys.path:
 # Rely on the glib/gobject compatibility import code in test-dbus.py.
 from testdbus import glib, gobject

-from testdbus import DBusUtil, timeout, property, usingValgrind, xdg_root,
bus, logging, NullLogging, loop
+from testdbus import DBusUtil, timeout, Timeout, property, usingValgrind,
xdg_root, bus, logging, NullLogging, loop
 import testdbus

 def timeFunction(func, *args1, **args2):
@@ -2677,15 +2677,21 @@ END:VCARD
                   raise Exception('%s:\n%s' % (msg, repr(ex))), None, info[2]
              else:
                   raise
+         finally:
+              daemon.remove_from_connection()

     @timeout(60)
-    # Must disable usage of pre-computed phone numbers from EDS, because we
can't tell EDS
-    # when locale is meant to change.
-    @property("ENV", "LANG=en_US.UTF-8 SYNCEVOLUTION_PIM_EDS_NO_E164=1")
+    @property("ENV", "LANG=en_US.UTF-8")
     def testLocaledPhone(self):
          # Parsing of 1234-5 depends on locale: US drops the 1 from 1234
          # Germany (and other countries) don't. Use that to match (or not
match)
          # a contact.
+
+         daemon = localed.Localed()
+         # Give EDS some time to notice the new daemon and it's en_US setting.
+         Timeout.addTimeout(5, loop.quit)
+         loop.run()
+
          testcases = (('Doe', '''BEGIN:VCARD
 VERSION:3.0
 FN:Doe
@@ -2698,7 +2704,6 @@ END:VCARD
          view = self.doFilter(testcases,
                               (([['phone', '+12345']], ('Doe',)),))

-         daemon = localed.Localed()
          msg = None
          try:
               # Contact no longer matched because it's phone number
normalization
@@ -2723,6 +2728,8 @@ END:VCARD
                   raise Exception('%s:\n%s' % (msg, repr(ex))), None, info[2]
              else:
                   raise
+         finally:
+              daemon.remove_from_connection()

     # Not supported correctly by ICU?
     # See icu-support "Subject: Austrian phone book sorting"


There might be simpler ways to trigger the problem, like running
evolution-addressbook-factory under valgrind and then manually changing the
localed settings.


You are receiving this mail because: