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 488881 - Evolution-data-server crashes when running syncevolution
Evolution-data-server crashes when running syncevolution
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: general
1.12.x (obsolete)
Other All
: Normal critical
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
: 485627 486834 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-10-22 06:18 UTC by Juha Siltala
Modified: 2008-07-03 16:58 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Valgrind output of e-d-s dying when running syncevolution (29.80 KB, text/plain)
2007-10-23 06:19 UTC, Juha Siltala
Details

Description Juha Siltala 2007-10-22 06:18:20 UTC
Steps to reproduce:
1. Run evolution
2. Run syncevolution


Stack trace:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1224643696 (LWP 11114)]
0xb7812af7 in g_str_hash () from /usr/lib/libglib-2.0.so.0
(gdb) thread apply all bt

Thread 6 (Thread -1224643696 (LWP 11114))

  • #0 g_str_hash
    from /usr/lib/libglib-2.0.so.0
  • #1 g_hash_table_lookup
    from /usr/lib/libglib-2.0.so.0
  • #2 e_cal_backend_file_modify_object
    at e-cal-backend-file.c line 1927
  • #3 e_cal_backend_sync_modify_object
    at e-cal-backend-sync.c line 262
  • #4 _e_cal_backend_modify_object
  • #5 e_cal_backend_modify_object
    at e-cal-backend.c line 915
  • #6 impl_Cal_modifyObject
    at e-data-cal.c line 339
  • #7 _ORBIT_skel_small_GNOME_Evolution_Calendar_Cal_modifyObject
    at Evolution-DataServer-Calendar-common.c line 116
  • #8 ??
    from /usr/lib/libORBit-2.so.0
  • #9 ??
  • #10 ??

Other information:
Here's the output when running e-d-s from a terminal and then syncevolution in another:

juha@oskar ~ >evolution --force-shutdown
Shutting down evolution-data-server-1.12 (Evolution Calendar file and webcal backend / Evolution Addressbook file backend)
Shutting down evolution-alarm-notify (Evolution Calendar alarm notification service)
juha@oskar ~ >/usr/lib/evolution/evolution-data-server-1.12 
evolution-data-server-Message: Starting server
e-data-server-Message: adding type `ECalBackendFileTodosFactory'
e-data-server-Message: adding type `ECalBackendFileEventsFactory'
e-data-server-Message: adding type `ECalBackendFileJournalFactory'
e-data-server-Message: adding type `ECalBackendContactsEventsFactory'
e-data-server-Message: adding type `EBookBackendGroupwiseFactory'
e-data-server-Message: adding type `ECalBackendCalDAVEventsFactory'
e-data-server-Message: adding type `EBookBackendLDAPFactory'
e-data-server-Message: adding type `EBookBackendFileFactory'
e-data-server-Message: adding type `EBookBackendVCFFactory'
e-data-server-Message: adding type `ECalBackendHttpTodosFactory'
e-data-server-Message: adding type `ECalBackendHttpEventsFactory'
e-data-server-Message: adding type `ECalBackendHttpMemosFactory'
e-data-server-Message: adding type `ECalBackendGroupwiseTodosFactory'
e-data-server-Message: adding type `ECalBackendGroupwiseEventsFactory'
e-data-server-Message: adding type `ECalBackendGroupwiseJournalFactory'
e-data-server-Message: adding type `ECalBackendWeatherEventsFactory'
in server_log_handler
evolution-data-server-Message: Server up and running
cal = 0x80568c0
cal = 0x8078f80
impl_GNOME_Evolution_Addressbook_BookFactory_getBook
 + file:///home/juha/.evolution/addressbook/local/system
 => 0x8078fb0
impl_GNOME_Evolution_Addressbook_Book_open (0x8078fb0)
cal = 0x80568f0
impl_GNOME_Evolution_Addressbook_Book_getContactList
sh: /usr/lib/libgnomeui-0/gnome_segv2: not found
Comment 1 Patrick Ohly 2007-10-22 22:02:09 UTC
I keep getting reports about this for SyncEvolution because SyncEvolution remains blocked in the synchronous libecal/libebook calls when the EDS dies, so for the user it looks like SyncEvolution just hangs. So far I have not been able to get a coherent overview of which Evolution versions are affected. There might even be different unrelated bugs causing it.

Juha, thanks for filing this bug. The stack back trace hints towards memory corruption in the EDS process. Can you try again with evolution-data-server-1.12 running under valgrind? Just "apt-get install valgrind", then run "valgrind /usr/lib/evolution/evolution-data-server-1.12".
Comment 2 Juha Siltala 2007-10-23 06:19:54 UTC
Created attachment 97700 [details]
Valgrind output of e-d-s dying when running syncevolution
Comment 3 Juha Siltala 2007-10-23 06:22:02 UTC
Patrick,

Evolution 2.12 on gutsy is the first version I have encountered this with. SyncEvolution is 0.6, rebuilt on Gutsy after distribution upgrade from Feisty.
Comment 4 Patrick Ohly 2007-10-25 21:27:46 UTC
I was able to reproduce a crash by running the SyncEvolution test suite for calendars with a self-compiled Evolution 2.12.1. Contacts seemed to be okay. To reproduce it:
* download syncevolution-0.7pre1.tar.gz from http://sourceforge.net/projects/sync4jevolution
* configure CXXFLAGS=-g --disable-shared
* make
* cd src
* make test
* CLIENT_TEST_EVOLUTION_PREFIX=file:///tmp/runtests ./client-test Client::Source::ical20

Eventually the test hangs and the dataserver has crashed. Note to self: use this as test case for the (still to be written) code which detects that aborts SyncEvolution when the dataserver dies.

I said "a crash" because I'm out of time not just for today and haven't even looked at a stack back trace. I won't have time before Sunday evening, more likely  it'll be next week before I can look more closely. I'm not even sure I'd be able to fix it, so if someone from the Evolution team looks at this problem first that would very be much appreciated.
Comment 5 Juha Siltala 2007-11-01 18:59:30 UTC
I did a little experiment while bored. I set "addressbook_1" to "refresh from server" in my syncevolution configuration and synced. EDS did not crash, and the sync was successful. Did the same for calendar_1 and todo_1, and it worked. After that, two-way sync works too.

Meanwhile, I had built syncevolution 0.7pre-1, so I'm not quite sure which was the reason for success, upgrade or the one-time sync with "refresh-from-server". Anyway, it's working.
Comment 6 Patrick Ohly 2007-11-01 19:15:54 UTC
Juha, as far as I have seen so far it seems to be updating an existing calendar entry which crashes. Was that part of your two-way syncs?
Comment 7 Juha Siltala 2007-11-01 19:34:00 UTC
Patrick,
Actually I seem to have been hasty. Two-way syncs _do_ crash EDS if anything has changed. My success was due to there not being any. :-\

So no, any actual syncing of changes are still not allowed.
Comment 8 Patrick Ohly 2007-11-01 22:00:03 UTC
I have Evolution 2.12.x (compiled from the 2.20 branch with debug information, unfortunately optimization also was on) running now on my desktop.  What I see is consistent with the stack backtrace reported above: a segfault in poll() from libc.

Thread 2 (Thread -1259709520 (LWP 21996))

  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 __lll_mutex_lock_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 _L_mutex_lock_29
    from /lib/tls/i686/cmov/libpthread.so.0
  • #3 ??
  • #4 ??
  • #5 ??
  • #6 _dl_runtime_resolve
    from /lib/ld-linux.so.2
  • #7 gnome_segv_handler
    at server.c line 101
  • #8 gnome_segv_handler
    at server.c line 101
  • #9 <signal handler called>
  • #10 IA__g_str_hash
    at gstring.c line 95
  • #11 IA__g_hash_table_lookup
    at ghash.c line 236
  • #12 e_cal_backend_file_modify_object
    at e-cal-backend-file.c line 1927
  • #13 cal=0x8240cf0, calobj=0x82e4cc9 "BEGIN:VEVENT\nSUMMARY:phone meeting\nDTEND:20060406T163000Z\nDTSTART:20060406T160000Z\nUID:\nDTSTAMP:20060406T211449Z\nLAST-MODIFIED:20060409T213201\nCREATED:20060409T213201\nLOCATION:my office\nDESCRIPTION:le"..., mod=CALOBJ_MOD_ALL, old_object=0xb4ea50dc, new_object=0xb4ea50d8) at e-cal-backend-sync.c:262
  • #14 _e_cal_backend_modify_object
    at e-cal-backend-sync.c line 746
  • #15 e_cal_backend_modify_object
    at e-cal-backend.c line 915
  • #16 impl_Cal_modifyObject
    at e-data-cal.c line 339
  • #18 ORBit_POAObject_invoke
    at poa.c line 1142
  • #19 ORBit_OAObject_invoke
    at orbit-adaptor.c line 338
  • #20 ORBit_small_invoke_adaptor
    at orbit-small.c line 844
  • #21 ORBit_POAObject_handle_request
    at poa.c line 1351
  • #22 ORBit_POAObject_invoke_incoming_request
    at poa.c line 1421
  • #23 giop_thread_queue_process
    at giop.c line 771
  • #24 giop_request_handler_thread
    at giop.c line 481
  • #25 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #26 g_thread_create_proxy
    at gthread.c line 634
  • #27 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #28 clone
    from /lib/tls/i686/cmov/libc.so.6

Comment 9 Patrick Ohly 2007-11-03 12:39:49 UTC
Okay, I found the reason. In Evolution 2.12.x the behavior of e_cal_create_object() for objects with a fixed UID has changed. Previously the call would fail if the UID was already used and then SyncEvolution falls back to updating that object, roughly like this:

if(!e_cal_create_object(m_calendar, subcomp, &uid, &gerror) &&
   gerror->domain == E_CALENDAR_ERROR &&
   gerror->code == E_CALENDAR_STATUS_OBJECT_ID_ALREADY_EXISTS) {
   e_cal_modify_object(m_calendar, subcomp, CALOBJ_MOD_ALL, &gerror)
}

This code no longer works because now e_cal_create_object() *removes* the conflicting UID. Then e_cal_modify_object() crashes because the hash is called with a NULL UID pointer.

I don't know if this change was intentional; perhaps it was added to allow a second e_cal_create_object() too succeed. I think it would have been better to preserve the old behavior and document it. Clients need to decide how to handle the E_CALENDAR_STATUS_OBJECT_ID_ALREADY_EXISTS error anyway and IMHO updating instead of duplicating the event is the more useful choice. If the client wanted to duplicate, it could clear the UID.

Anyway, now that the reason is clear it was easy to add a workaround. Now the code makes less assumptions about e_cal_create_object() (which is always good) and restores the UID before e_cal_modify_object(). I'll keep the issue open until I have a SyncEvolution with the workaround released, then close it.

Thanks to all who helped investigate this and to Matthew Barnes for pointing me in the right direction on the Evo developer list.
Comment 10 Juha Siltala 2007-11-08 09:20:23 UTC
Just an update: the fix in SyncEvolution from current CVS seems to work here.
Comment 11 Patrick Ohly 2007-11-10 17:44:16 UTC
SyncEvolution 0.7 pre2 has been released and contains the fix.

Can someone from the Evolution team please close this bug? I don't have the authorization for that. Thanks for your patience!

Comment 12 Juha Siltala 2007-11-15 13:07:41 UTC
Closing.
Comment 13 Milan Crha 2008-07-03 16:55:58 UTC
*** Bug 485627 has been marked as a duplicate of this bug. ***
Comment 14 Milan Crha 2008-07-03 16:58:26 UTC
*** Bug 486834 has been marked as a duplicate of this bug. ***