[Ace-users] Re: TAO-ORB: Server crashes intermittently on restarts

mak khan.m.arshad at gmail.com
Fri Jul 20 22:44:10 CDT 2007


Is this a TAO bug or a wrong usage?

Anybody?

On Jul 17, 6:47 pm, mak <khan.m.ars... at gmail.com> wrote:
> On Jul 16, 6:15 pm, mak <khan.m.ars... at gmail.com> wrote:
>
>
>
> >     TAO VERSION: 1.5.9
> >     ACE VERSION: 5.5.9
>
> >     HOST MACHINE and OPERATING SYSTEM:
>
> >     Linux 2.6.20-1.2320.fc5smp #1 SMP i686 i686 i386 GNU/Linux
>
> >     TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
>
> >     COMPILER NAME AND VERSION (AND PATCHLEVEL):
>
> >     g++ (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)
>
> >     THE $ACE_ROOT/ace/config.h FILE :
>
> >     #include "ace/config-linux.h"
>
> >     THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:
>
> >     include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU
>
> >     CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/
> > default.features
> >     :
>
> >     AREA/CLASS/EXAMPLE AFFECTED:
>
> >     ORB
>
> >     DOES THE PROBLEM AFFECT:
> >         COMPILATION?
>
> >         "No"
>
> >         LINKING?
>
> >         "No"
>
> >         EXECUTION?
>
> >         "Yes"
>
> >         OTHER (please specify)?
>
> >     SYNOPSIS:
>
> >     Server crashes intermittently on restarts.
>
> >     DESCRIPTION:
>
> >     My application provides Server restart functionality when a
> > certain
> >     IDL method is called by a remote client. The restart process is
> > sometimes
> >     successful and sometimes ends in segmentation fault.
>
> >     The SEGV happens in ORB::run method. The core file indicates
> > following
> >     place for the crash:
>
> > Program terminated with signal 11, Segmentation fault.
> > #0  0x09e08990 in ?? ()
> > (gdb) where
> > #0  0x09e08990 in ?? ()
> > #1  0x001c5c02 in TAO_ORB_Core::run (this=0x9e08e48, tv=0x0,
> > perform_work=0)
> >     at /home/akhan/ecp/software/external/acetao/TAO/tao/
> > LF_Event_Loop_Thread_Helper.inl:24
> > #2  0x001bfb7c in CORBA::ORB::run (this=0x9df4540, tv=0x0) at ORB.cpp:
> > 202
> > #3  0x001bfbe5 in CORBA::ORB::run (this=0x9df4540) at ORB.cpp:188
> > #4  0x080501dd in RestartTestTPWorker::svc (this=0x9dfed40) at
> > RestartTestRunner.cpp:250
> > #5  0x008d3e56 in ACE_Task_Base::svc_run (args=0x9dfed40) at Task.cpp:
> > 271
> > #6  0x008d4818 in ACE_Thread_Adapter::invoke_i (this=0x9e153f8) at
> > Thread_Adapter.cpp:146
> > #7  0x008d49e6 in ACE_Thread_Adapter::invoke (this=0x9e153f8) at
> > Thread_Adapter.cpp:95
> > #8  0x008693d1 in ace_thread_adapter (args=0x9e153f8) at
> > Base_Thread_Adapter.cpp:116
> > #9  0x00db3433 in start_thread () from /lib/libpthread.so.0
> > #10 0x00c0ba1e in clone () from /lib/libc.so.6
> > (gdb)
>
> >     It could be something that I'm doing wrong. I have my suspicion on
> > the
> >     way I reset reactor event loop on restart. Any help is very much
> >     appreciated.
>
> >     Thanks
> >     Arshad
>
> >     REPEAT BY:
>
> > Test case follows. Apologies for a rather long test case.:(. Please
> > let
> > me know if there are any questions about the test case.
>
> > The files are:
>
> > 1. RestartTest.idl: Interface definition.
> > 2. RestartTestIntf_i.h|cpp : CORBA servant implementing the IDL
> > interface.
> > 3. RestartTestRunner.h|cpp : Class containing ORB initialize and
> > shutdown methods.
> >                              Also contains class for ORB Thread Pool
> > Worker.
> > 4. server.cpp : Server main. Also contains Signal handler class to
> > handle
> >                 SIGINT.
> > 5. client.cpp : Client main.
>
> > How to build:
> > 1. Generate make files.
> > $ACE_ROOT/bin/mwc.pl -type gnuace restart.mwc
>
> > 2. Do the make
> > make
>
> > How to run:
> > 1. Run the server (make sure port 1234 is available)
> > ./server -ORBEndPoint iiop://localhost:1234
>
> > 2. Run the client
> > ./client -ORBInitRef Test=corbaloc::localhost:1234/Test
>
> > Expected Result:
> > "The server should restart successfully on multiple invocation of the
> > client."
>
> > Observed Result:
> > "The server restarts but gets a segmentation fault after a few client
> >  invocations."
>
> > ----- File: RestartTest.idl -----
> > module RestartTest {
>
> >   /**
> >    * Restart Test interface.
> >    */
> >   interface RestartTestIntf {
>
> >    /**
> >     * A two way method to exercise the server.
> >     */
> >     string test_echo_string(in string message);
>
> >    /**
> >     * Restarts the server.
> >     */
> >     oneway void test_restart();
>
> >    /**
> >     * Shutsdown the server.
> >     */
> >     oneway void test_shutdown();
> >   };
>
> > };
>
> > -------------------------------------
>
> > ----- File: RestartTestIntf_i.h -----
>
> > #ifndef RESTART_TEST_INTF_I_H
> > #define RESTART_TEST_INTF_I_H
>
> > #include /**/ "ace/pre.h"
>
> > #include "RestartTestS.h"
>
> > class RestartTestIntf_i :
> >       public virtual POA_RestartTest::RestartTestIntf
> > {
> > public:
> >     /**
> >      * Constructor.
> >      */
> >     RestartTestIntf_i() {}
>
> >     /**
> >      * Destructor
> >      */
> >     ~RestartTestIntf_i() {}
>
> >     /**
> >      * A two way method to exercise the server.
> >      * @param value Passed in string.
> >      * @return Returns back the passed in string.
> >      */
> >     virtual char * test_echo_string(const char * value);
>
> >     /**
> >      * Restarts the server.
> >      */
> >     virtual void test_restart();
>
> >     /**
> >      * Shutsdown the server.
> >      */
> >     virtual void test_shutdown();
>
> > };
>
> > #include /**/ "ace/post.h"
> > #endif /* RESTART_TEST_INTF_I_H */
>
> > -------------------------------------
>
> > ----- File: RestartTestIntf_i.cpp -----
>
> > #include "RestartTestIntf_i.h"
> > #include "RestartTestRunner.h"
>
> > #include "ace/Signal.h"
>
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > //
> > // test_echo_string
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > char *
> > RestartTestIntf_i::test_echo_string(const char * value)
> > {
> >     ACE_DEBUG ((LM_DEBUG,
> >               "(%P|%t) RestartTestIntf_i::test_echo_string.\n"));
>
> >    char * retVal = CORBA::string_dup(value);
>
> >    return retVal;
>
> > }
>
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > //
> > // test_restart
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > void
> > RestartTestIntf_i::test_restart()
> > {
> >     ACE_DEBUG ((LM_DEBUG,
> >               "(%P|%t) RestartTestIntf_i::test_restart.\n"));
>
> >     // Set the restart flag to true so that main method can
> >     // re-init the RestartTestRunner.
>
> >     RestartTestRunner::mRestart = true;
>
> >     // Send a SIGINT signal to the signal handler for
> >     // shutdown (and then a restart)
>
> >     ACE_OS::kill(ACE_OS::getpid(), SIGINT);
>
> > }
>
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > //
> > // test_shutdown
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > void
> > RestartTestIntf_i::test_shutdown()
> > {
> >     ACE_DEBUG ((LM_DEBUG,
> >               "(%P|%t) RestartTestIntf_i::test_shutdown.\n"));
>
> >     // Set the restart flag to true so that main method can
> >     // does not restarts the server.
>
> >     RestartTestRunner::mRestart = false;
>
> >     // Send a SIGINT signal to the signal handler for
> >     // shutdown.
>
> >     ACE_OS::kill(ACE_OS::getpid(), SIGINT);
>
> > }
>
> > -------------------------------------
>
> > ----- File: RestartTestRunner.h -----
>
> > #ifndef RESTART_TEST_RUNNER_H
> > #define RESTART_TEST_RUNNER_H
>
> > #include /**/ "ace/pre.h"
> > #include "ace/Task.h"
> > #include "tao/ORB.h"
> > #include "tao/PortableServer/PortableServer.h"
>
> > // Flag to conditionally compile TAO Singleton Manager's Initialize
> > // and finalization.
>
> > #define DO_SING_MGR_INIT_FINI   1
>
> > /**
> >  * Thread Pool worker class.
> >  *
> >  * Objects of this class represent a thread pool worker. Each worker
> >  * executes the orb->run method and services incoming requests.
> >  */
>
> > class RestartTestTPWorker : public ACE_Task_Base {
>
> > private:
>
> >     /// An initialized ORB instance.
> >     CORBA::ORB_var pOrb;
>
> > public:
>
> >     /**
> >      * Constructor
> >      */
>
> >     RestartTestTPWorker (CORBA::ORB_ptr orb);
>
> >     /**
> >      * Destructor
> >      */
>
> >     virtual ~RestartTestTPWorker();
>
> >     /**
> >      * Thread svc method.
> >      */
>
> >     virtual int svc(void);
>
> > }; /* RestartTestTPWorker */
>
> > /**
> >  * Class that initializes the ORB and POAs and instantiate
> >  * thread pool workers.
> >  */
> > class RestartTestRunner {
>
> > private:
>
> >     /// Command line arguments.
> >     int mArgc;
> >     char **pArgv;
>
> >     /// ORB instance.
> >     CORBA::ORB_var pOrb;
>
> >     /// POA instance for servicing rqeuests.
> >     PortableServer::POA_var pTestPOA;
>
> >     /// Thread Pool worker instance.
> >     RestartTestTPWorker * pWorkers;
>
> >     /// Flag indicating if the ORB is initialized successfully.
> >     bool mInited;
>
> > public:
>
> >     /// Flag used for indicating whether a restart is needed.
> >     static bool mRestart;
>
> >     /**
> >      * Constructor
> >      */
>
> >     RestartTestRunner (int argc, char *argv[]);
>
> >     /**
> >      * Destructor
> >      */
>
> >     virtual ~RestartTestRunner();
>
> >     /**
> >      * Initializes ORB and POAs.
> >      */
>
> >     virtual int initialize(void);
>
> >     /**
> >      * Shuts down the ORB.
> >      */
>
> >     virtual int shutdown();
>
> > };
>
> > #include /**/ "ace/post.h"
> > #endif /* RestartTestRunner */
>
> > -------------------------------------
>
> > ----- File: RestartTestRunner.cpp -----
>
> > #include "RestartTestRunner.h"
> > #include "RestartTestIntf_i.h"
> > #include "ace/ARGV.h"
> > #include "tao/Object.h"
> > #include "tao/IORTable/IORTable.h"
> > #include "tao/TAO_Singleton_Manager.h"
>
> > // Public fields and methods for RestartTestRunner.
>
> > bool RestartTestRunner::mRestart = false;
>
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > //
> > // Constructor
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > RestartTestRunner::RestartTestRunner(int argc, char *argv[])
> >         : mArgc(argc),
> >           pArgv(argv),
> >           pOrb(CORBA::ORB::_nil()),
> >           pWorkers(0),
> >           mInited(false)
>
> > {
>
> > }
>
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > //
> > // Destructor
> > //X//////////////////////X////////////////////
> > X//////////////////////////
> > RestartTestRunner::~RestartTestRunner()
> > {
>
> ...
>
> read more »- Hide quoted text -
>
> - Show quoted text -




More information about the Ace-users mailing list