(no subject)



Hello all!


I have one problem with deadlock in reference counting. I have
ORBit-2.8.1 and libbonobo-2.4 from rawhide srpms on RedHat 7.3.

My program has BonoboObject, which I call "parent".
This parent can create childs which is BonoboObjects too.
Child has reference to parent.

What I do:

struct child {
 BonoboObject *parent;
}

child_finalize (child)
{
 ..
  bonobo_object_unref(child->parent)
  ..
}

child_new (BonoboObject *parent)
{
 ..
 child->parent = parent;
 bonobo_object_ref(parent);
 ..
}

In client I do unref on parent, then on child. Program doesn't cancel
execution and stays on mutex in child_finalize. Here is the backtrace. 
Note than g_idle_add (bonobo_object_unref, parent) works, is it right way?

Can somebody help me? Thanks for attention.


(gdb) bt
#0  0x420292e5 in sigsuspend () from /lib/i686/libc.so.6
#1  0x40675679 in __pthread_wait_for_restart_signal ()
   from /lib/i686/libpthread.so.0
#2  0x406774b9 in __pthread_alt_lock () from /lib/i686/libpthread.so.0
#3  0x40674116 in pthread_mutex_lock () from /lib/i686/libpthread.so.0
#4  0x4060ca23 in PortableServer_POA_servant_to_id ()
   from /usr/lib/libORBit-2.so.0
#5  0x4058edf9 in bonobo_object_corba_deactivate_T ()
   from /usr/lib/libbonobo-2.so.0
#6  0x4058ef6c in bonobo_object_finalize_internal_T ()
   from /usr/lib/libbonobo-2.so.0
#7  0x4058f2b6 in bonobo_object_unref () from /usr/lib/libbonobo-2.so.0
#8  0x0804eabb in child_finalize (object=0x808a788) at inferior.c:379
#9  0x4063ae13 in g_object_last_unref () from /usr/lib/libgobject-2.0.so.0
#10 0x4063e4f9 in g_object_unref () from /usr/lib/libgobject-2.0.so.0
#11 0x4058f03f in bonobo_object_finalize_servant ()
   from /usr/lib/libbonobo-2.so.0
#12 0x4060a588 in ORBit_POA_deactivate_object () from /usr/lib/libORBit-2.so.0
#13 0x4060b414 in ORBit_POAObject_post_invoke () from /usr/lib/libORBit-2.so.0
#14 0x4060ac9d in ORBit_POAObject_handle_request ()
   from /usr/lib/libORBit-2.so.0
#15 0x4060ad6f in ORBit_POAObject_invoke_incoming_request ()
   from /usr/lib/libORBit-2.so.0
---Type <return> to continue, or q <return> to quit---
#16 0x4060b1f7 in ORBit_POA_handle_request () from /usr/lib/libORBit-2.so.0
#17 0x4060e742 in ORBit_handle_request () from /usr/lib/libORBit-2.so.0
#18 0x405f8b00 in giop_connection_handle_input () from /usr/lib/libORBit-2.so.0
#19 0x405d93ce in link_connection_io_handler ()
   from /usr/lib/libORBitCosNaming-2.so.0
#20 0x405db18f in link_source_dispatch ()
   from /usr/lib/libORBitCosNaming-2.so.0
#21 0x406cc464 in g_main_dispatch () from /usr/lib/libglib-2.0.so.0
#22 0x406cd2f1 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#23 0x406cd6b1 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#24 0x406cddc0 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#25 0x4058abf7 in bonobo_main () from /usr/lib/libbonobo-2.so.0
#26 0x0804c4c5 in main (argc=1, argv=0xbffff944) at main.c:187
#27 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6
(gdb)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]