<div dir="ltr">Hi Phil,<br><br>thanks for getting back to me on this issue.<br><br>To answer your questions:<br><br>Our application is using a round trip timeout policy of 500 ms.<br><br>The TAO_Connector::connect() is using the TAO-specific connection timeout?<br><br>    (gdb) frame 25<br>    #25 0xb57f69ab in TAO_Connector::connect (this=0x8f9a298, r=0xbfa11de4, desc=0xbfa11d44, timeout=0xbfa11e70)<br>        at Transport_Connector.cpp:613<br>    613                  if (this->wait_for_transport (r, base_transport, timeout, false))<br>    (gdb) print *timeout<br>    $2 = {static zero = {static zero = <same as static member of an already seen type>, static max_time = {<br>          static zero = <same as static member of an already seen type>, <br>          static max_time = <same as static member of an already seen type>, tv_ = {tv_sec = 2147483647, <br>            tv_usec = 999999}}, tv_ = {tv_sec = 0, tv_usec = 0}}, <br>      static max_time = <same as static member of an already seen type>, tv_ = {tv_sec = 0, tv_usec = 0}}<br><br>We are using a thread pool reactor with a single thread in the thread pool.<br><br>The main thread of the application is handling the SIGQUIT.<br><br>The SIGQUIT signal handler basically abort()s the application:<br>    #0  0xb52ad387 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64<br>    #1  0xb52b0702 in *__GI_abort () at abort.c:121<br>    #2  0xb36e0726 in ?? () from /usr/lib/libGraphicsMagick.so.3<br>    #3  <signal handler called><br>       <br>There are four other threads running in the process, two of them related to lttng and the other two running ACE threads:<br><br>    (gdb) info threads<br>      Id   Target Id         Frame <br>      5    Thread 0xaf671b70 (LWP 1030) 0xb5353037 in select () at ../sysdeps/unix/syscall-template.S:82<br>      4    Thread 0xb0699b70 (LWP 1028) syscall () at ../sysdeps/unix/sysv/linux/i386/syscall.S:31<br>      3    Thread 0xaecffb70 (LWP 1031) 0xb534ab91 in read () at ../sysdeps/unix/syscall-template.S:82<br>      2    Thread 0xafe99b70 (LWP 1029) syscall () at ../sysdeps/unix/sysv/linux/i386/syscall.S:31<br>    * 1    Thread 0xb25eb790 (LWP 1027) 0xb52ad387 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64<br>    <br>    (gdb) thread 2<br>    (gdb) bt<br>    #0  syscall () at ../sysdeps/unix/sysv/linux/i386/syscall.S:31<br>    #1  0xb6db41d0 in ?? () from /usr/lib/i386-linux-gnu/liblttng-ust.so.0<br>    #2  0xb6db4451 in ?? () from /usr/lib/i386-linux-gnu/liblttng-ust.so.0<br>    #3  0xb526f954 in start_thread (arg=0xafe99b70) at pthread_create.c:304<br>    #4  0xb5359c1e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130<br>    <br>    (gdb) thread 3<br>    (gdb) bt<br>    #0  0xb534ab91 in read () at ../sysdeps/unix/syscall-template.S:82<br>    #1  0x0808095a in read (handle=<optimized out>, len=1, buf=0xaecff0cd) at /usr/lib/ace/ace/OS_NS_unistd.inl:738<br>    #2  recv (n=1, buf=0xaecff0cd, this=0x8fa3768) at /usr/lib/ace/ace/Pipe.inl:143<br>    #3  read (this=0x8fa3764)<br>    #4  MyToolNode::svc (this=0x8fa3488)<br>    #5  0xb56aa3d3 in ACE_Task_Base::svc_run (args=0x8fa36a8) at Task.cpp:271<br>    #6  0xb56ac085 in ACE_Thread_Adapter::invoke_i (this=0xaed039e0) at Thread_Adapter.cpp:161<br>    #7  0xb56ac1d3 in ACE_Thread_Adapter::invoke (this=0xaed039e0) at Thread_Adapter.cpp:96<br>    #8  0xb564366f in ace_thread_adapter (args=0xaed039e0) at Base_Thread_Adapter.cpp:122<br>    #9  0xb526f954 in start_thread (arg=0xaecffb70) at pthread_create.c:304<br>    #10 0xb5359c1e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130<br>    <br>    (gdb) thread 4<br>    (gdb) bt<br>    #0  syscall () at ../sysdeps/unix/sysv/linux/i386/syscall.S:31<br>    #1  0xb6db41d0 in ?? () from /usr/lib/i386-linux-gnu/liblttng-ust.so.0<br>    #2  0xb6db4451 in ?? () from /usr/lib/i386-linux-gnu/liblttng-ust.so.0<br>    #3  0xb526f954 in start_thread (arg=0xb0699b70) at pthread_create.c:304<br>    #4  0xb5359c1e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130<br>    <br>    (gdb) thread 5<br>    (gdb) bt<br>    #0  0xb5353037 in select () at ../sysdeps/unix/syscall-template.S:82<br>    #1  0xb75ddd21 in OtherTool::doAction (this=this@entry=0xbfa127f0)<br>    #2  0xb75def18 in OtherTool::svc (this=0xbfa127f0)<br>    #3  0xb56aa3d3 in ACE_Task_Base::svc_run (args=0xbfa127f0) at Task.cpp:271<br>    #4  0xb56ac085 in ACE_Thread_Adapter::invoke_i (this=0x8fa1280) at Thread_Adapter.cpp:161<br>    #5  0xb56ac1d3 in ACE_Thread_Adapter::invoke (this=0x8fa1280) at Thread_Adapter.cpp:96<br>    #6  0xb564366f in ace_thread_adapter (args=0x8fa1280) at Base_Thread_Adapter.cpp:122<br>    #7  0xb526f954 in start_thread (arg=0xaf671b70) at pthread_create.c:304<br>    #8  0xb5359c1e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130<br><br>This is the full (sanitized) stack of the main thread:<br><br>    #0  0xb52ad387 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64<br>    #1  0xb52b0702 in *__GI_abort () at abort.c:121<br>    #2  0xb36e0726 in ?? () from /usr/lib/libGraphicsMagick.so.3<br>    #3  <signal handler called><br>    #4  mmap () at ../sysdeps/unix/sysv/linux/i386/mmap.S:65<br>    #5  0xb52f59f3 in new_heap (size=147496, top_pad=<optimized out>) at arena.c:745<br>    #6  0xb52f68bd in sYSMALLOc (av=<optimized out>, nb=<optimized out>) at malloc.c:3126<br>    #7  _int_malloc (av=<optimized out>, bytes=<optimized out>) at malloc.c:4776<br>    #8  0xb52f82ec in *__GI___libc_malloc (bytes=16388) at malloc.c:3660<br>    #9  0xb5466845 in operator new (sz=16388) at ../../../../src/libstdc++-v3/libsupc++/new_opnt.cc:44<br>    #10 0xb5466903 in operator new[] (sz=16388, nothrow=...) at ../../../../src/libstdc++-v3/libsupc++/new_opvnt.cc:34<br>    #11 0xb567aa4c in ACE_Notification_Queue::allocate_more_buffers (this=this@entry=0x8f7fe70)<br>        at Notification_Queue.cpp:83<br>    #12 0xb567afa8 in ACE_Notification_Queue::push_new_notification (this=0x8f7fe70, buffer=...)<br>        at Notification_Queue.cpp:172<br>    #13 0xb569b534 in ACE_Select_Reactor_Notify::notify (this=0x8f7fe48, event_handler=0x0, mask=0, timeout=0x80ede60)<br>        at Select_Reactor_Base.cpp:697<br>    #14 0xb563b491 in ACE_Select_Reactor_T<ACE_Reactor_Token_T<ACE_Token> >::notify (this=0x8f7f718, eh=0x0, mask=0, <br>        timeout=0x80ede60) at /tmp/buildd/ace-6.0.3/ace/Select_Reactor_T.cpp:213<br>    #15 0xb563b538 in ACE_Select_Reactor_T<ACE_Reactor_Token_T<ACE_Token> >::wakeup_all_threads (this=0x8f7f718)<br>        at /tmp/buildd/ace-6.0.3/ace/Select_Reactor_T.inl:196<br>    #16 0xb563e5d6 in ACE_Select_Reactor_T<ACE_Reactor_Token_T<ACE_Token> >::deactivate (this=0x8f7f718, do_stop=1)<br>        at /tmp/buildd/ace-6.0.3/ace/Select_Reactor_T.inl:227<br>    #17 0xb579dfe2 in end_reactor_event_loop (this=<optimized out>) at /tmp/buildd/ace-6.0.3/ace/Reactor.inl:107<br>    #18 TAO_Leader_Follower::reset_client_thread (this=this@entry=0x8f7eec8) at Leader_Follower.cpp:183<br>    #19 0xb579e530 in ~TAO_LF_Client_Thread_Helper (this=<synthetic pointer>, __in_chrg=<optimized out>)<br>        at /tmp/buildd/ace-6.0.3/TAO/tao/Leader_Follower.inl:217<br>    #20 TAO_Leader_Follower::wait_for_event (this=0x8f7eec8, event=0x9323c7ec, transport=0x9321f8e0, <br>        max_wait_time=0xbfa11e70) at Leader_Follower.cpp:423<br>    #21 0xb57a04ad in TAO_LF_Connect_Strategy::wait_i (this=this@entry=0x8f9a348, ev=0x9323c7ec, <br>        transport=transport@entry=0x9321f8e0, max_wait_time=max_wait_time@entry=0xbfa11e70)<br>        at LF_Connect_Strategy.cpp:51<br>    #22 0xb576983d in TAO_Connect_Strategy::wait (this=0x8f9a348, t=0x9321f8e0, max_wait_time=0xbfa11e70)<br>        at Connect_Strategy.cpp:40<br>    #23 0xb57f4f12 in wait_for_transport (force_wait=false, timeout=0xbfa11e70, transport=0x9321f8e0, r=0xbfa11de4, <br>        this=0x8f9a298) at Transport_Connector.cpp:418<br>    #24 TAO_Connector::wait_for_transport (this=0x8f9a298, r=0xbfa11de4, transport=0x9321f8e0, timeout=0xbfa11e70, <br>        force_wait=false) at Transport_Connector.cpp:348<br>    #25 0xb57f69ab in TAO_Connector::connect (this=0x8f9a298, r=0xbfa11de4, desc=0xbfa11d44, timeout=0xbfa11e70)<br>        at Transport_Connector.cpp:613<br>    #26 0xb57ccb13 in TAO::Profile_Transport_Resolver::try_connect_i (this=this@entry=0xbfa11de4, <br>        desc=desc@entry=0xbfa11d44, timeout=timeout@entry=0xbfa11e70, parallel=parallel@entry=false)<br>        at Profile_Transport_Resolver.cpp:171<br>    #27 0xb57cccc3 in TAO::Profile_Transport_Resolver::try_connect (this=0xbfa11de4, desc=0xbfa11d44, <br>        timeout=0xbfa11e70) at Profile_Transport_Resolver.cpp:114<br>    #28 0xb5799ca8 in TAO_Default_Endpoint_Selector::select_endpoint (this=0x8f7cae8, r=0xbfa11de4, <br>        max_wait_time=0xbfa11e70) at Invocation_Endpoint_Selectors.cpp:66<br>    #29 0xb57cc89c in TAO::Profile_Transport_Resolver::resolve (this=0xbfa11de4, max_time_val=0xbfa11e70)<br>        at Profile_Transport_Resolver.cpp:85<br>    #30 0xb579821c in TAO::Invocation_Adapter::invoke_remote_i (this=0xbfa11fbc, stub=0x93209060, details=..., <br>        effective_target=..., max_wait_time=@0xbfa11e64: 0xbfa11e70) at Invocation_Adapter.cpp:239<br>    #31 0xb5798cc0 in TAO::Invocation_Adapter::invoke_i (this=0xbfa11fbc, stub=0x93209060, details=...)<br>        at Invocation_Adapter.cpp:92<br>    #32 0xb5798076 in TAO::Invocation_Adapter::invoke (this=0xbfa11fbc, ex_data=0x0, ex_count=0)<br>        at Invocation_Adapter.cpp:46<br>    #33 0xb57cf2fb in TAO::Remote_Object_Proxy_Broker::_is_a (this=0xb5844748, target=0x9320d378, <br>        type_id=0xb75eb30c "IDL:MyApp/Dispatcher:1.0") at Remote_Object_Proxy_Broker.cpp:39<br>    #34 0xb57aa845 in CORBA::Object::_is_a (this=0x9320d378, type_id=0xb75eb30c "IDL:MyApp/Dispatcher:1.0")<br>        at Object.cpp:220<br>    #35 0xb745ca2c in narrow (pbf=0xb746ad10 <MyApp__TAO_Dispatcher_Proxy_Broker_Factory_function(CORBA::Object*)>, <br>        repo_id=0xb75eb30c "IDL:MyApp/Dispatcher:1.0", obj=0x9320d378) at /usr/include/tao/Object_T.cpp:27<br>    #36 MyApp::Dispatcher::_narrow (_tao_objref=0x9320d378) at generated/DispatcherC.cpp:1361<br>    #37 0x08089b26 in downcast_objref<MyApp::Dispatcher> (a_object=0x9320d378)<br>    #38 0x08089ce3 in lookup_initref<MyApp::Dispatcher> (a_orb=0xfffffff4, a_name="Dispatcher")<br>    #39 0x08088f9f in _get_service (a_orb=<optimized out>, this=<optimized out>)<br>    #40 MyObject::doMyObjectAction_Unsafe (this=0xaed14bb8)<br>    #41 0x08089780 in MyObject::doMyObjectAction (this=0xaed14bb8)<br>    #42 0x08089930 in operator() (p=<optimized out>, this=0xaed14c20) at /usr/include/boost/bind/mem_fn_template.hpp:49<br>    #43 operator()<boost::_mfi::mf0<void, MyObject>, boost::_bi::list0> (f=..., this=0xaed14c28, a=...)<br>        at /usr/include/boost/bind/bind.hpp:253<br>    #44 operator() (this=0xaed14c20) at /usr/include/boost/bind/bind_template.hpp:20<br>    #45 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, MyObject>, boost::_bi::list1<boost::_bi::value<MyObject*> > >, void>::invoke (function_obj_ptr=...)<br>        at /usr/include/boost/function/function_template.hpp:153<br>    #46 0xb75cfca3 in operator() (this=<optimized out>) at /usr/include/boost/function/function_template.hpp:760<br>    #47 UpcallGuardLock::~UpcallGuardLock (this=0x9321f7b0, __in_chrg=<optimized out>)<br>    #48 0xb75cfe59 in checked_delete<UpcallGuardLock> (x=0x9321f7b0) at /usr/include/boost/checked_delete.hpp:34<br>    #49 boost::detail::sp_counted_impl_p<UpcallGuardLock>::dispose (this=0x92ca20e8)<br>        at /usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78<br>    #50 0x080897b8 in release (this=<optimized out>)<br>        at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145<br>    #51 ~shared_count (this=<optimized out>, __in_chrg=<optimized out>)<br>        at /usr/include/boost/smart_ptr/detail/shared_count.hpp:305<br>    #52 ~shared_ptr (this=<optimized out>, __in_chrg=<optimized out>) at /usr/include/boost/smart_ptr/shared_ptr.hpp:164<br>    #53 MyObject::doMyObjectAction (this=0x92ca20e8)<br>    #54 0x08089930 in operator() (p=<optimized out>, this=0xaed14be8) at /usr/include/boost/bind/mem_fn_template.hpp:49<br>    #55 operator()<boost::_mfi::mf0<void, MyObject>, boost::_bi::list0> (f=..., this=0xaed14bf0, a=...)<br>        at /usr/include/boost/bind/bind.hpp:253<br>    #56 operator() (this=0xaed14be8) at /usr/include/boost/bind/bind_template.hpp:20<br>    #57 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf0<void, MyObject>, boost::_bi::list1<boost::_bi::value<MyObject*> > >, void>::invoke (function_obj_ptr=...)<br>        at /usr/include/boost/function/function_template.hpp:153<br>    #58 0xb7574b8a in operator() (this=<optimized out>) at /usr/include/boost/function/function_template.hpp:760<br>    #59 AsynchronousTask::handle_exception (this=0xaed14be8)<br>    #60 0xb569b438 in ACE_Select_Reactor_Notify::dispatch_notify (this=0x8f7fe48, buffer=...)<br>        at Select_Reactor_Base.cpp:837<br>    #61 0xb56b5f26 in ACE_TP_Reactor::handle_notify_events (this=this@entry=0x8f7f718, guard=...) at TP_Reactor.cpp:377<br>    #62 0xb56b6194 in ACE_TP_Reactor::dispatch_i (this=this@entry=0x8f7f718, max_wait_time=max_wait_time@entry=0x0, <br>        guard=...) at TP_Reactor.cpp:229<br>    #63 0xb56b6267 in ACE_TP_Reactor::handle_events (this=0x8f7f718, max_wait_time=0x0) at TP_Reactor.cpp:169<br>    #64 0xb57b63ae in handle_events (max_wait_time=0x0, this=0x8f7f2c0) at /tmp/buildd/ace-6.0.3/ace/Reactor.inl:188<br>    #65 TAO_ORB_Core::run (this=0x8f7b940, tv=0x0, perform_work=0) at ORB_Core.cpp:2225<br>    #66 0xb57b13cd in CORBA::ORB::run (this=this@entry=0x8f7f2d0, tv=tv@entry=0x0) at ORB.cpp:188<br>    #67 0xb57b1433 in CORBA::ORB::run (this=0x8f7f2d0) at ORB.cpp:174<br>    #68 0xb758ec13 in NodeRunner::run (this=0x8fa1380, limit=...)<br>    #69 0x0807bc7b in run (called_as="MyApp_MyTool", argc=18, argv=argv@entry=0xbfa12a14, orb=...)<br>    #70 0x08071b9c in main (argc=18, argv=0xbfa12a14)<br><br>Best regards,<br>Erik<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 14, 2015 at 4:14 PM, Phil Mesnier <span dir="ltr"><<a href="mailto:mesnierp@ociweb.com" target="_blank">mesnierp@ociweb.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Eric,<br>
<br>
Thank you for the PRF.<br>
<br>
First, I assume you are using either the round trip timeout policy or the TAO-specific connection timeout. I agree that a while (true) loop seems risky, I suspect you've uncovered a deeper issue. How many threads are in the ORB thread pool?<br>
Which thread handles the sigquit? what all does the signal handler do?<br>
<br>
Does the stack you shared go deeper? Like maybe there is another connect attempt pending?<br>
<br>
I've got some ideas but I'd like to see your responses before going further.<br>
<br>
Best regards,<br>
Phil<br>
<br>
> On Sep 14, 2015, at 6:10 AM, Erik Cumps <<a href="mailto:erik.cumps@esaturnus.com">erik.cumps@esaturnus.com</a>> wrote:<br>
><br>
> Hello,<br>
><br>
> I know this issue is hard to reproduce, but the failure sequence is worth investigating,<br>
> an applciation exit or crash is preferable to an infinite loop.<br>
><br>
> Any insights or comments anyone?<br>
><br>
> Thanks,<br>
> Erik Cumps<br>
><br>
> On vr, 2015-08-07 at 14:59 +0200, Erik Cumps wrote:<br>
>>     TAO VERSION: 2.3.0<br>
>>     ACE VERSION: 6.3.0<br>
>><br>
>>     HOST MACHINE and OPERATING SYSTEM:<br>
>>         32-bit i686, Linux 3.2.35, debian wheezy<br>
>><br>
>>     TARGET MACHINE and OPERATING SYSTEM, if different from HOST:<br>
>>         same as HOST<br>
>><br>
>>     COMPILER NAME AND VERSION (AND PATCHLEVEL):<br>
>>         gcc (Debian 4.7.2-5) 4.7.2<br>
>><br>
>>     THE $ACE_ROOT/ace/config.h FILE:<br>
>>         // $Id$<br>
>><br>
>>         #ifndef ACE_CONFIG_H_INCLUDED<br>
>>         #define ACE_CONFIG_H_INCLUDED<br>
>>         #ifdef __FreeBSD_kernel__<br>
>>         #include "config-kfreebsd.h"<br>
>>         #elif defined(__GNU__)<br>
>>         #include "config-hurd.h"<br>
>>         #else // assume linux<br>
>>         /*<br>
>>          * Macros that were enabled in Debian are stored here.<br>
>>          *<br>
>>          * Rationale: those were captured in the generated libraries on<br>
>>          * compilation; hence the same values must be used when<br>
>> including<br>
>>          * ACE+TAO headers, to avoid unexpected results.<br>
>>          */<br>
>><br>
>>         #if defined(ACE_HAS_IPV6)<br>
>>         #undef ACE_HAS_IPV6<br>
>>         #endif<br>
>><br>
>>         #ifndef ACE_USES_IPV4_IPV6_MIGRATION<br>
>>         #define ACE_USES_IPV4_IPV6_MIGRATION 0<br>
>>         #endif<br>
>><br>
>>         #ifndef __ACE_INLINE__<br>
>>         #define __ACE_INLINE__<br>
>>         #endif<br>
>><br>
>>         #include "config-linux.h"<br>
>>         #endif // __FreeBSD_version<br>
>>         #endif /* ACE_CONFIG_H_INCLUDED */<br>
>><br>
>>     THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:<br>
>>         # $Id$<br>
>><br>
>>         debug          = 1<br>
>>         optimize       = 1<br>
>>         inline         = 1<br>
>><br>
>>         ssl            = 1<br>
>><br>
>>         xt             = 1<br>
>>         tk             = 1<br>
>>         fl             = 1<br>
>>         fox            = 1<br>
>>         qt4            = 1<br>
>>         ace_qt4reactor = 1<br>
>><br>
>>         bzip2          = 1<br>
>>         lzo1           = 1<br>
>>         zlib           = 1<br>
>><br>
>>         # Work-around #593225<br>
>>         ARMEL_TARGET := $(shell echo '__ARMEL__' | $(CC) -E - | tail -n<br>
>> 1)<br>
>>         ifeq ($(ARMEL_TARGET),1)<br>
>>           no_hidden_visibility = 1<br>
>>         endif<br>
>><br>
>>         include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU<br>
>><br>
>>         PLATFORM_FOX_CPPFLAGS=-I/usr/include/fox-1.6<br>
>>         PLATFORM_FOX_LIBS=-lFOX-1.6<br>
>><br>
>>     CONTENTS OF<br>
>> $ACE_ROOT/bin/MakeProjectCreator/config/default.features:<br>
>>         // Misc<br>
>>         acexml          = 1<br>
>>         ace_svcconf     = 1<br>
>>         ace_token       = 1<br>
>>         ssl             = 1<br>
>>         ipv6            = 0<br>
>>         exceptions      = 1<br>
>><br>
>>         // GUI reactors<br>
>>         xt              = 1<br>
>>         ace_xtreactor   = 1<br>
>>         tao_xtresource  = 1<br>
>><br>
>>         tk              = 1<br>
>>         ace_tkreactor   = 1<br>
>>         tao_tkresource  = 1<br>
>><br>
>>         fl              = 1<br>
>>         ace_flreactor   = 1<br>
>>         tao_flresource  = 1<br>
>><br>
>>         qt              = 1<br>
>>         qt4             = 1<br>
>>         ace_qtreactor   = 1<br>
>>         tao_qtresource  = 1<br>
>><br>
>>         fox             = 1<br>
>>         ace_foxreactor  = 1<br>
>>         tao_foxresource = 1<br>
>><br>
>>         // ZIOP<br>
>>         zlib          = 1<br>
>>         zzip          = 1<br>
>>         bzip2         = 1<br>
>>         lzo1          = 1<br>
>><br>
>><br>
>>     AREA/CLASS/EXAMPLE AFFECTED:<br>
>>         Transport handling. (Transport_Connector.cpp)<br>
>><br>
>>     DOES THE PROBLEM AFFECT:<br>
>>         EXECUTION?<br>
>><br>
>>     SYNOPSIS:<br>
>> A process fails to complete its shutdown because the<br>
>> TAO_Connector::connect()<br>
>> method is stuck in an infinite loop.<br>
>><br>
>>     DESCRIPTION:<br>
>> The system is under heavy load. While the process is stopping its<br>
>> servants<br>
>> and is shutting down the ORB, and because of scheduling delays<br>
>> introduced by<br>
>> the heavy load, it tries to perform a remote object invocation, which<br>
>> requires<br>
>> the setup of a new Transport connection.<br>
>><br>
>> This is handled by the TAO_Connector::connect() method, which states:<br>
>>    // Stay in this loop until we find:<br>
>>    // a usable connection, or a timeout happens<br>
>><br>
>> In this particular case the tcm.find_transport() call returns:<br>
>> TAO::Transport_Cache_Manager::CACHE_FOUND_CONNECTING.<br>
>><br>
>> Which means the following code is executed:<br>
>>         else if (found ==<br>
>> TAO::Transport_Cache_Manager::CACHE_FOUND_CONNECTING)<br>
>>           {<br>
>>             if (r->blocked_connect ())<br>
>>               {<br>
>>                 ...<br>
>>                 // If wait_for_transport returns no errors, the<br>
>> base_transport<br>
>>                 // points to the connection we wait for.<br>
>>                 if (this->wait_for_transport (r, base_transport,<br>
>> timeout, false))<br>
>>                   {<br>
>>                     // be sure this transport is registered with the<br>
>> reactor<br>
>>                     // before using it.<br>
>>                     if (!base_transport->register_if_necessary ())<br>
>>                       {<br>
>>                           base_transport->remove_reference ();<br>
>>                           return 0;<br>
>>                       }<br>
>>                   }<br>
>><br>
>>                 ...<br>
>>         // In either success or failure cases of wait_for_transport, the<br>
>>                 // ref counter in corresponding to the ref counter added<br>
>> by<br>
>>                 // find_transport is decremented.<br>
>>                 base_transport->remove_reference ();<br>
>>               }<br>
>>             else<br>
>>               {<br>
>>                 ...<br>
>>                 // return the transport in it's current, unconnected<br>
>> state<br>
>>                 return base_transport;<br>
>>               }<br>
>>           }<br>
>><br>
>> The only way out of the loop in this particular state is if:<br>
>> * r->blocked_connect() returns false<br>
>> * wait_for_transport() returns true and the base transport fails to<br>
>> register<br>
>> * tcm.find_transport() returns a different result than<br>
>> CACHE_FOUND_CONNECTING<br>
>><br>
>> In this particular case neither of these conditions are true and the<br>
>> loop is<br>
>> therefore not exited. Instead the code keeps invoking<br>
>> wait_for_transport(),<br>
>> which incidentally tries to send a notification event to the reactor (so<br>
>> that<br>
>> it can stop) and these notification events pile up in a queue because<br>
>> the<br>
>> reactor cannot consume them (it is blocked waiting for the remote object<br>
>> invocation to complete and that itself is blocked waiting for a<br>
>> transport<br>
>> connection).<br>
>><br>
>> To give some further indication of the state of the code, here is a<br>
>> (elided<br>
>> and simplified) stacktrace, obtained after terminating the process with<br>
>> a<br>
>> SIGQUIT signal:<br>
>><br>
>> The first part of the stacktrace contains the part where the code tries<br>
>> to<br>
>> notify the reactor that it should stop. As you can see it is pushing the<br>
>> notification events onto the queue. At this point, the queue contained<br>
>> already 157297 notifications:<br>
>> (gdb) print *this<br>
>> $3 = {<ACE_Copy_Disabled> = {<No data fields>}, alloc_queue_ = {head_ =<br>
>> 0x8f7feb0, cur_size_ = 157297, allocator_ =<br>
>> The end_reactor_event_loop() is being called because the has_shutdown()<br>
>> method of the orb_core_ is true.<br>
>><br>
>> #11 0xb567aa4c in ACE_Notification_Queue::allocate_more_buffers<br>
>> #12 0xb567afa8 in ACE_Notification_Queue::push_new_notification<br>
>> #13 0xb569b534 in ACE_Select_Reactor_Notify::notify<br>
>> #14 0xb563b491 in ACE_Select_Reactor_T<ACE_Reactor_Token_T<ACE_Token><br>
>> >::notify<br>
>> #15 0xb563b538 in ACE_Select_Reactor_T<ACE_Reactor_Token_T<ACE_Token><br>
>> >::wakeup_all_threads<br>
>> #16 0xb563e5d6 in ACE_Select_Reactor_T<ACE_Reactor_Token_T<ACE_Token><br>
>> >::deactivate<br>
>> #17 0xb579dfe2 in end_reactor_event_loop<br>
>> #18 TAO_Leader_Follower::reset_client_thread<br>
>> #19 0xb579e530 in ~TAO_LF_Client_Thread_Helper<br>
>><br>
>> The next part contains the TAO_Connector::connect() invocation. From the<br>
>> size<br>
>> of the notification queue we can determine that it has already spent a<br>
>> lot of<br>
>> time in the loop (at least long enough for more than 150000<br>
>> notifications)<br>
>><br>
>> #20 TAO_Leader_Follower::wait_for_event<br>
>> #21 0xb57a04ad in TAO_LF_Connect_Strategy::wait_i<br>
>> #22 0xb576983d in TAO_Connect_Strategy::wait<br>
>> #23 0xb57f4f12 in wait_for_transport<br>
>> #24 TAO_Connector::wait_for_transport<br>
>> #25 0xb57f69ab in TAO_Connector::connect<br>
>><br>
>> The final part shows that the TAO_Connector::connect() is invoked<br>
>> because the<br>
>> process tries to perform a remote object invocation:<br>
>><br>
>> #26 0xb57ccb13 in TAO::Profile_Transport_Resolver::try_connect_i<br>
>> #27 0xb57cccc3 in TAO::Profile_Transport_Resolver::try_connect<br>
>> #28 0xb5799ca8 in TAO_Default_Endpoint_Selector::select_endpoint<br>
>> #29 0xb57cc89c in TAO::Profile_Transport_Resolver::resolve<br>
>> #30 0xb579821c in TAO::Invocation_Adapter::invoke_remote_i<br>
>> #31 0xb5798cc0 in TAO::Invocation_Adapter::invoke_i<br>
>> #32 0xb5798076 in TAO::Invocation_Adapter::invoke<br>
>> #33 0xb57cf2fb in TAO::Remote_Object_Proxy_Broker::_is_a<br>
>> #34 0xb57aa845 in CORBA::Object::_is_a<br>
>> #35 0xb745ca2c in narrow<br>
>> #36 MyApp::Dispatcher::_narrow<br>
>> #37 0x08089b26 in downcast_objref<MyApp::Dispatcher><br>
>> #38 0x08089ce3 in lookup_initref<MyApp::Dispatcher><br>
>> #39 0x08088f9f in _get_service<br>
>> #40 MyObject::doMyObjectAction_Unsafe<br>
>> #41 0x08089780 in MyObject::doMyObjectAction<br>
>><br>
>>     REPEAT BY:<br>
>> This bug is hard to induce.<br>
>><br>
>>     SAMPLE FIX/WORKAROUND:<br>
>> Would it make sense for TAO_Connector::connect() to verify the time it<br>
>> spends<br>
>> waiting for the connection and exit the loop if it detects the timeout?<br>
>><br>
>><br>
>><br>
><br>
> _______________________________________________<br>
> ace-bugs mailing list<br>
> <a href="mailto:ace-bugs@list.isis.vanderbilt.edu">ace-bugs@list.isis.vanderbilt.edu</a><br>
> <a href="http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/ace-bugs" rel="noreferrer" target="_blank">http://list.isis.vanderbilt.edu/cgi-bin/mailman/listinfo/ace-bugs</a><br>
<br>
--<br>
Phil Mesnier<br>
Principal Software Engineer and Partner,   <a href="http://www.ociweb.com" rel="noreferrer" target="_blank">http://www.ociweb.com</a><br>
Object Computing, Inc.                     +01.314.579.0066 x225<br>
<br>
<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><font color="#535454" face="arial, helvetica, sans-serif" size="2">Erik Cumps</font></div><div><font color="#535454" face="arial, helvetica, sans-serif" size="2">Senior Software Developer</font></div><div><font color="#535454" face="arial, helvetica, sans-serif" size="2"><br></font></div><div><font color="#535454" face="arial, helvetica, sans-serif" size="2">eSATURNUS</font></div><div><font color="#535454" face="arial, helvetica, sans-serif" size="2">T. +32 16 40 12 82</font></div><div><font color="#535454" face="arial, helvetica, sans-serif" size="2"><a href="http://www.esaturnus.com" target="_blank">www.esaturnus.com</a></font></div><div><font color="#535454" face="arial, helvetica, sans-serif" size="2"><img src="https://www.google.com/a/esaturnus.com/images/logo.gif?alpha=1"><br></font></div></div></div>
</div>