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 561354 - conduit locks up in EvoCalendarTwoWay.refresh() method
conduit locks up in EvoCalendarTwoWay.refresh() method
Status: RESOLVED FIXED
Product: conduit
Classification: Other
Component: dataproviders
0.3.x
Other All
: Normal normal
: ---
Assigned To: conduit-maint@gnome.bugs
conduit-maint@gnome.bugs
: 561090 568056 (view as bug list)
Depends on: 571829
Blocks:
 
 
Reported: 2008-11-18 12:55 UTC by choeger
Modified: 2009-02-24 11:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
conduit backtrace on freeze (86.73 KB, application/octet-stream)
2009-01-30 22:06 UTC, Mario Manno
Details
test case (604 bytes, text/x-python)
2009-02-23 19:34 UTC, John Stowers
Details

Description choeger 2008-11-18 12:55:48 UTC
Steps to reproduce:
1. add evolution calendar dataprovider to a group
2. press refresh
3. lockup


Stack trace:


Other information:
This happens on fedora 10 using conduit-0.3.14 and evolution 2.24
please note that this simple python program runs fine:

#!/usr/bin/env python

import evolution
from evolution import ecal
print evolution.__version__
cal = ecal.open_calendar_source('default',ecal.CAL_SOURCE_TYPE_EVENT)
print cal

so I could not figure out, whats going on there, but it seems to be some real thread weirdness.
Comment 1 Roumano 2008-11-18 17:03:54 UTC
It's not the same as Bug 561090 ?
Comment 2 choeger 2008-11-18 17:12:48 UTC
No, obviously there is a python error that can be found and fixed. I encounter lockups _without_ any usefull error messages.
Comment 3 Lars Strojny 2008-12-29 17:09:22 UTC
I'm experiencing the same issue on an Ubuntu 8.10
Comment 4 Mario Manno 2009-01-30 22:06:31 UTC
Created attachment 127589 [details]
conduit backtrace on freeze

Same issue with CAL_SOURCE_TYPE_TODO. Simple script works fine, conduit hangs in EvolutionModule.py:303.
I loaded python into gdb, ran conduit, clicked 'refresh' on a evo task item and the gui stopped responding. I then pressed ctrl-c to obtain a backtrace. I'm missing a few symbols though.
Comment 5 Julien Lavergne 2009-01-31 23:15:07 UTC
I can confirm this on Debian with evolution 2.22 and conduit-trunk, and for all evolution dataproviders.
Comment 6 John Stowers 2009-02-13 11:32:58 UTC
*** Bug 561090 has been marked as a duplicate of this bug. ***
Comment 7 John Stowers 2009-02-13 11:33:30 UTC
Bollocks. Dunno what is up here.
Comment 8 Neil Loknath 2009-02-14 02:17:53 UTC
No idea if this helps at all, but I tried building Evolution 2.25.9 and had the same problem.

I tried getting a backtrace during a recreation of the problem with Evolution 2.24, but it looks pretty useless. :S
Comment 9 Julien Lavergne 2009-02-22 14:45:28 UTC
Some more testing :
conduit 0.3.15 on Debian repository work.
rebuilding the same source on actual Debian Sid have the bug.

The build was made on December 22, so I think it's a bug in a python package update since this date.
Comment 10 Michael 2009-02-22 17:43:02 UTC
Here's a traceback of the relevant thread could it be related to the version of libebook, libbonobo or libORBIT?

(gdb) bt
  • #0 __kernel_vsyscall
  • #1 pthread_cond_wait
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 giop_recv_buffer_get
    from /usr/lib/libORBit-2.so.0
  • #3 ORBit_small_invoke_stub
    from /usr/lib/libORBit-2.so.0
  • #4 ORBit_small_invoke_stub_n
    from /usr/lib/libORBit-2.so.0
  • #5 ORBit_c_stub_invoke
    from /usr/lib/libORBit-2.so.0
  • #6 Bonobo_Unknown_ref
    from /usr/lib/libbonobo-activation.so.4
  • #7 bonobo_object_dup_ref
    from /usr/lib/libbonobo-2.so.0
  • #8 bonobo_context_add
    from /usr/lib/libbonobo-2.so.0
  • #9 ??
    from /usr/lib/libbonobo-2.so.0
  • #10 bonobo_context_init
    from /usr/lib/libbonobo-2.so.0
  • #11 bonobo_init_full
    from /usr/lib/libbonobo-2.so.0
  • #12 bonobo_init
    from /usr/lib/libbonobo-2.so.0
  • #13 e_book_new
    from /usr/lib/libebook-1.2.so.9
  • #14 e_book_new_default_addressbook
    from /usr/lib/libebook-1.2.so.9
  • #15 evo_addressbook_open
    at evo-addressbook.c line 124
  • #16 _wrap_evo_addressbook_open
    at ebook.c line 1589
  • #17 PyEval_EvalFrameEx
    at ../Python/ceval.c line 3595
  • #18 PyEval_EvalFrameEx
    at ../Python/ceval.c line 3681
  • #19 PyEval_EvalFrameEx
    at ../Python/ceval.c line 3681
  • #20 PyEval_EvalFrameEx
    at ../Python/ceval.c line 3681
  • #21 PyEval_EvalCodeEx
    at ../Python/ceval.c line 2858
  • #22 function_call
    at ../Objects/funcobject.c line 517
  • #23 PyObject_Call
    at ../Objects/abstract.c line 1861
  • #24 instancemethod_call
    at ../Objects/classobject.c line 2519
  • #25 PyObject_Call
    at ../Objects/abstract.c line 1861
  • #26 PyEval_CallObjectWithKeywords
    at ../Python/ceval.c line 3464
  • #27 t_bootstrap
    at ../Modules/threadmodule.c line 427
  • #28 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #29 clone
    from /lib/tls/i686/cmov/libc.so.6

Comment 11 John Stowers 2009-02-22 22:35:45 UTC
*** Bug 568056 has been marked as a duplicate of this bug. ***
Comment 12 John Stowers 2009-02-22 22:46:08 UTC
(In reply to comment #9)
> Some more testing :
> conduit 0.3.15 on Debian repository work.
> rebuilding the same source on actual Debian Sid have the bug.
> 
> The build was made on December 22, so I think it's a bug in a python package
> update since this date.
> 

I cannot think what caused the bug. The python-gnome-desktop package has not bee updated in a while, and my usage of it has not changed. It must be something else that has changed, something the evo hackers changed.
Comment 13 Michael 2009-02-23 11:54:23 UTC
But simple test cases work, like the following, so it seems to be something to do with the way the module is used in conduit?

from EvolutionModule import *

a=EvoContactTwoWay("default")
print a
a.refresh()
contactList=a.get_all()
for contact in contactList:
    print a.get(contact)
Comment 14 John Stowers 2009-02-23 12:02:52 UTC
(In reply to comment #13)
> But simple test cases work, like the following, so it seems to be something to
> do with the way the module is used in conduit?
> 
> from EvolutionModule import *
> 
> a=EvoContactTwoWay("default")
> print a
> a.refresh()
> contactList=a.get_all()
> for contact in contactList:
>     print a.get(contact)
> 

Conduits use of the module has not changed, which I think points to a confusing and hard to debug threading bug. Sounds like fun to fix. It must have been introduced in libebook or something
Comment 15 Michael 2009-02-23 15:34:01 UTC
I can recreate the bug, most of the time I run following code. I was attempting to get simultaneous ebook calls. But can this happen in conduit, i.e. multiple simultaneous threads making ebook calls?


from threading import Thread

from EvolutionModule import *
import random,  time,  os

class testit(Thread):
    def __init__ (self):
      Thread.__init__(self)
    def run(self):
        a=EvoContactTwoWay()
        r=random.uniform(1,  2)
        name=self.getName()+" (%d)" % os.getpid()
        print "%s Sleeping for %f"  % (name, r)
        time.sleep(r)
        a.refresh()
        contactList=a.get_all()
        for contact in contactList:
            print "%s Contact %s" % (name,  a.get(contact))


for i in range(2):
    test=testit()
    test.start()
Comment 16 John Stowers 2009-02-23 19:26:04 UTC
(In reply to comment #15)
> I can recreate the bug, most of the time I run following code. I was attempting
> to get simultaneous ebook calls. But can this happen in conduit, i.e. multiple
> simultaneous threads making ebook calls?

No, or at least it certainly does not happen in a conduit test case that reliably triggers the bug. (Create a EvoContactTwoWay and click refresh)

In that case. the closest thing to multiple thread access is non concurrent access to evoltuion from different threads. For example there is a call in EvoContact.__init__ that gets the available addressbooks, and another call in refresh() that gets the contacts. Code in refresh() , get(), get_all(), put() are all accessed in a different thread to that in __init__, but this should not be a problem if the gtk threading system has been initialized (gtk.gdk.threads_init(), which it has)

> 
> 
> from threading import Thread
> 
> from EvolutionModule import *
> import random,  time,  os
> 
> class testit(Thread):
>     def __init__ (self):
>       Thread.__init__(self)
>     def run(self):
>         a=EvoContactTwoWay()
>         r=random.uniform(1,  2)
>         name=self.getName()+" (%d)" % os.getpid()
>         print "%s Sleeping for %f"  % (name, r)
>         time.sleep(r)
>         a.refresh()
>         contactList=a.get_all()
>         for contact in contactList:
>             print "%s Contact %s" % (name,  a.get(contact))
> 
> 
> for i in range(2):
>     test=testit()
>     test.start()
> 

Cool. To clarify a little, my suspicion regarding usage from multiple threads requires at least one of the threads to be the gtk MainLoop. Also, you should call gtk.gdk.threads_init(), or gobject.threads_init()
Comment 17 John Stowers 2009-02-23 19:34:26 UTC
Created attachment 129362 [details]
test case

Running this reliably triggers the problem. The threaded access is not concurrent
Comment 18 Dominic Evans 2009-02-23 22:42:33 UTC
Attachment in comment #17 reliably triggers problem on Ubuntu Jaunty with latest updates as of 2009-02-23
Comment 19 Michael 2009-02-23 23:21:43 UTC
I used the test case to try and trace where the hang occurs and got down to 

bonobo_context_init (); in bonobo-main.c in libbonobo

Comment 20 Gustavo Carneiro 2009-02-24 11:01:51 UTC
The problem happens because bonobo_init is being called on-demand by e-d-s:

  • #11 bonobo_init
    at bonobo-main.c line 256
  • #12 e_book_new
    at e-book.c line 3723
  • #13 e_book_new_from_uri
    at e-book.c line 3787
  • #14 e_book_new_system_addressbook
    at e-book.c line 3850
  • #15 e_book_new_default_addressbook
    at e-book.c line 3909
  • #16 evo_addressbook_open
    at ../evolution/evo-addressbook.c line 124
  • #17 _wrap_evo_addressbook_open
    at ../evolution/ebook.c line 1604

Moving the bonobo initialization to the python script fixed the problem.  All we need is to 'import bonobo' at the top.  I'll fix the python evolution modules to do it automatically during import.
Comment 21 John Stowers 2009-02-24 11:47:20 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.