Hi,

we (want to) use MICO within a plugin for a proprietary graphics
application (Tecplot).
This plugin serves the purpose of providing an online-interface to an
object in Tecplot, that we want to transfer to our own application.

Well, with a former version of MICO (2.3.9) everything worked fine. But
it doesn't anymore with 2.3.11. I verified that all of the CORBA/MICO
code constructs actually work, so I really cannot imagine where the
problem lies here. Could be MICO as well as the other application.

Our first guess was that it would have to do with multithreading issues,
since the symptoms looked like races. E.g. sometimes the plugin gets
loaded and spits out an IOR, another time it doesn't load at all...

Can anybody offer an educated guess about whats going on here?

Thanks very much in advance,
/Markus
Tecplot: single-threaded

MICO version...........: 2.3.11
supported CORBA version: 2.3
CCM support............: no
exceptions.............: CORBA compliant
modules are mapped to..: namespaces
STL is.................: system supplied
Security support.......: no
loadable modules.......: yes
multi-threading........: no

main.cxx-standard       - works with unmodified "RootPOA"
main.cxx-single         - forks off a child-POA with SINGLE_THREAD_MODEL




WITH main.cxx-standard


Signal = 11
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z17PrintCurBacktraceP8_IO_FILEi+0x34)[0xb756d4c0]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so[0xb7427621]
[0xffffe440]
/usr/lib/libstdc++.so.6[0xb5854042]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x27)[0xb589c887]
/usr/lib/libstdc++.so.6(_ZNSsD1Ev+0x4d)[0xb589d88d]
/usr/local/lib/libmico2.3.11.so(_ZN7MICOPOA8POA_implC1EPN5CORBA3ORBE+0x460)[0xb5c0e7a0]
/usr/local/lib/libmico2.3.11.so(_ZN5CORBA3ORB27_resolve_initial_referencesEPKc+0x17c)[0xb5b0b97c]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtdsaddon.so(_ZN5CORBA3ORB26resolve_initial_referencesEPKc+0x38)[0xb5e88568]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtdsaddon.so(InitTecAddOn+0xa4)[0xb5e88082]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z36OpenDynamicLibraryAndRunInitFunction13LibraryType_ePKcS1_PPv+0xab)[0xb72d579b]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z9LoadAddOnPKcS0_13LibraryType_e+0x1ca)[0xb72d5422]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z16Action_LoadAddOnPKcS0_13LibraryType_eS0_+0x15d)[0xb72d4451]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so[0xb745f525]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z20ProcessActionCommandPKciS0_iS0_PPcics+0x893)[0xb74658ab]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z19ProcessMacroCommandPKcisS0_PPcics+0x308)[0xb7456884]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z22ProcessLinkedMacroListcccccc+0x328)[0xb7452e64]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z15LoadAndRunMacroPKccccc+0x1cf)[0xb74542f3]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z16InitializeAddOnsv+0x316)[0xb74288fe]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z7StartUpiPPc+0xb0)[0xb74f1904]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(q_main+0x1e)[0xb74f196a]
/home/markus/proj/GeniasGraphics/tecplot/bin/tecplot.shared(main+0x22)[0x8048752]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xd2)[0xb6e8eea2]
/home/markus/proj/GeniasGraphics/tecplot/bin/tecplot.shared(q_main+0x3d)[0x80486a1]



WITH main.cxx-single


Signal = 11
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z17PrintCurBacktraceP8_IO_FILEi+0x34)[0xb748d4c0]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so[0xb7347621]
[0xffffe440]
/usr/lib/libstdc++.so.6[0xb576d042]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x27)[0xb57b5887]
/usr/lib/libstdc++.so.6(_ZNSsD1Ev+0x4d)[0xb57b688d]
/usr/local/lib/libmico2.3.11.so(_ZN7MICOPOA8POA_implC1EPN5CORBA3ORBE+0x460)[0xb5b277a0]
/usr/local/lib/libmico2.3.11.so(_ZN5CORBA3ORB27_resolve_initial_referencesEPKc+0x17c)[0xb5a2497c]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtdsaddon.so(_ZN5CORBA3ORB26resolve_initial_referencesEPKc+0x38)[0xb5da4d36]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtdsaddon.so(InitTecAddOn+0xa4)[0xb5da4420]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z36OpenDynamicLibraryAndRunInitFunction13LibraryType_ePKcS1_PPv+0xab)[0xb71f579b]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z9LoadAddOnPKcS0_13LibraryType_e+0x1ca)[0xb71f5422]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z16Action_LoadAddOnPKcS0_13LibraryType_eS0_+0x15d)[0xb71f4451]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so[0xb737f525]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z20ProcessActionCommandPKciS0_iS0_PPcics+0x893)[0xb73858ab]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z19ProcessMacroCommandPKcisS0_PPcics+0x308)[0xb7376884]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z22ProcessLinkedMacroListcccccc+0x328)[0xb7372e64]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z15LoadAndRunMacroPKccccc+0x1cf)[0xb73742f3]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z16InitializeAddOnsv+0x316)[0xb73488fe]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(_Z7StartUpiPPc+0xb0)[0xb7411904]
/home/markus/proj/GeniasGraphics/tecplot/lib/libtec.so(q_main+0x1e)[0xb741196a]
/home/markus/proj/GeniasGraphics/tecplot/bin/tecplot.shared(main+0x22)[0x8048752]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xd2)[0xb6daeea2]
/home/markus/proj/GeniasGraphics/tecplot/bin/tecplot.shared(q_main+0x3d)[0x80486a1]

Tecplot: multi-threaded

MICO version...........: 2.3.11
supported CORBA version: 2.3
CCM support............: no
exceptions.............: CORBA compliant
modules are mapped to..: namespaces
STL is.................: system supplied
Security support.......: no
loadable modules.......: yes
multi-threading........: no

main.cxx-standard       - works with unmodified "RootPOA"
main.cxx-single         - forks off a child-POA with SINGLE_THREAD_MODEL


WITH main.cxx-standard


/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(PrintCurBacktrace__FP8_IO_FILEi+0x37)[0xb6d18203]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so[0xb6bbec40]
[0xffffe420]
/usr/local/lib/libmico2.3.11.so(_ZN12PInterceptor12IORInfo_implC1EPN14PortableServer3POAEPN5CORBA3IORE+0xbb)[0xb2ffc31b]
/usr/local/lib/libmico2.3.11.so(_ZN7MICOPOA8POA_implC1EPN5CORBA3ORBE+0x625)[0xb2fbb965]
/usr/local/lib/libmico2.3.11.so(_ZN5CORBA3ORB27_resolve_initial_referencesEPKc+0x17c)[0xb2eb897c]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtdsaddon.so(_ZN5CORBA3ORB26resolve_initial_referencesEPKc+0x38)[0xb3235578]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtdsaddon.so(InitTecAddOn+0xa4)[0xb3235092]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(OpenDynamicLibraryAndRunInitFunction__F13LibraryType_ePCcT1PPv+0xf8)[0xb6a4ca4c]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(LoadAddOn__FPCcT013LibraryType_e+0x1c7)[0xb6a4c6c3]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(Action_LoadAddOn__FPCcT013LibraryType_eT0+0x6b)[0xb6a4b5a3]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so[0xb6bf634a]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(ProcessActionCommand__FPCciT0iT0PPcics+0xd9b)[0xb6bfcd1f]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(ProcessMacroCommand__FPCcisT0PPcics+0x115)[0xb6becf2d]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(ProcessLinkedMacroList__Fcccccc+0xc91)[0xb6bea1e5]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(LoadAndRunMacro__FPCccccc+0x215)[0xb6beabcd]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(InitializeAddOns__Fv+0x9f)[0xb6bbc83f]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(StartUp__FiPPc+0x10a)[0xb6c9169e]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(q_main+0x1f)[0xb6c916eb]
/home/markus/proj/GeniasGraphics/tecplot-ng/bin/tecplot.shared(main+0x1f)[0x804868f]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xd2)[0xb6657ea2]
/home/markus/proj/GeniasGraphics/tecplot-ng/bin/tecplot.shared(__register_frame_info+0x3d)[0x8048591]

Tecplot received shutdown signal #11.






WITH main.cxx-single


/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(PrintCurBacktrace__FP8_IO_FILEi+0x37)[0xb6cc5203]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so[0xb6b6bc40]
[0xffffe420]
/usr/local/lib/libmico2.3.11.so(_ZN12PInterceptor12IORInfo_implC1EPN14PortableServer3POAEPN5CORBA3IORE+0xbb)[0xb2fa231b]
/usr/local/lib/libmico2.3.11.so(_ZN7MICOPOA8POA_implC1EPN5CORBA3ORBE+0x625)[0xb2f61965]
/usr/local/lib/libmico2.3.11.so(_ZN5CORBA3ORB27_resolve_initial_referencesEPKc+0x17c)[0xb2e5e97c]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtdsaddon.so(_ZN5CORBA3ORB26resolve_initial_referencesEPKc+0x38)[0xb31ded36]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtdsaddon.so(InitTecAddOn+0xa4)[0xb31de420]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(OpenDynamicLibraryAndRunInitFunction__F13LibraryType_ePCcT1PPv+0xf8)[0xb69f9a4c]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(LoadAddOn__FPCcT013LibraryType_e+0x1c7)[0xb69f96c3]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(Action_LoadAddOn__FPCcT013LibraryType_eT0+0x6b)[0xb69f85a3]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so[0xb6ba334a]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(ProcessActionCommand__FPCciT0iT0PPcics+0xd9b)[0xb6ba9d1f]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(ProcessMacroCommand__FPCcisT0PPcics+0x115)[0xb6b99f2d]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(ProcessLinkedMacroList__Fcccccc+0xc91)[0xb6b971e5]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(LoadAndRunMacro__FPCccccc+0x215)[0xb6b97bcd]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(InitializeAddOns__Fv+0x9f)[0xb6b6983f]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(StartUp__FiPPc+0x10a)[0xb6c3e69e]
/home/markus/proj/GeniasGraphics/tecplot-ng/lib/libtec.so(q_main+0x1f)[0xb6c3e6eb]
/home/markus/proj/GeniasGraphics/tecplot-ng/bin/tecplot.shared(main+0x1f)[0x804868f]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xd2)[0xb6604ea2]
/home/markus/proj/GeniasGraphics/tecplot-ng/bin/tecplot.shared(__register_frame_info+0x3d)[0x8048591]

Tecplot received shutdown signal #11.




#include "TECADDON.h"
#include "ADDGLBL.h"

#include "CORBA.h"
#include "TecplotCorba.h"
#include "TecplotCorba_impl.h"

//#include "/usr/local/include/mico/orb_mico.h"

#include <iostream>

AddOn_pa AddOnID;

// The ORB
CORBA::ORB_var pORB = NULL;
/**
 */
static void STDCALL MenuCallback(void)
{
  TecUtilLockOn();
  TecUtilLockOff();
}

static Boolean_t PollORB( ArbParam_t pData )
{
  TecUtilLockOn();
  //std::cerr << "DEBUG: Enter PollORB" << std::endl;

  while ( pORB->work_pending( ) )
  {
  std::cerr << "DEBUG: WHILE work_pending" << std::endl;
    pORB->perform_work( );
  std::cerr << "DEBUG: perform_work" << std::endl;
  }

  TecUtilLockOff();

  return TRUE;
}

/**
 * When Tecplot first loads an add-on, it makes a 
 * call to initialize the add-on. This function
 * must be named InitTecAddOn, as shown below.
 */
EXPORTFROMADDON void STDCALL InitTecAddOn(void)
{


  /*
   * NOTE:  TecUtilLockOn MUST be used for InitTecAddOn instead
   *        of TecUtilLockStart because AddonID has yet to be
   *        established.  TecUtilLockOn is in effect an "annonymous"
   *        locking of tecplot (old style).
   */

  TecUtilLockOn();

  /*
   * The function TecUtilAddOnRegister() is the
   * only function that is REQUIRED to be called from
   * the initialization function.
   *
   * The information you give Tecplot by calling
   * this function will show up in the Help/About Add-ons
   * dialog box.
   */

  /*
   * Note that if your add-on requires a specific version of Tecplot,
   * you would check for that here using TecUtilGetTecplotVersion()
   */

  AddOnID = TecUtilAddOnRegister(
      100,
      ADDON_NAME,
      "V"ADDON_VERSION"("TecVersionId") "ADDON_DATE,
      "Genias Graphics GmbH");


  //TecUtilMenuAddOption(
  //    "Tools",
  //    "T-XL",
  //    '\0',
  //    MenuCallback);

  int argc = 1;
  char* argv[] = { "nop" };

  try
  {
    // Get the orb
    pORB = CORBA::ORB_init( argc, argv);

    // Get the root POA
    CORBA::Object_var pRootPOAObj = 
            pORB->resolve_initial_references( "RootPOA" );
    PortableServer::POA_var pRootPOA = 
            PortableServer::POA::_narrow( pRootPOAObj );
    assert(!CORBA::is_nil(pRootPOA));
    
    // Create a single-threaded object
    PortableServer::ThreadPolicy_var single =
            pRootPOA->create_thread_policy(PortableServer::SINGLE_THREAD_MODEL);
    
    // Child policy list (use "single" object)
    CORBA::PolicyList policy;
    policy.length(1);
    policy[0] = single;

    // Activate the POA manager
    PortableServer::POAManager_var rPOAManager = pRootPOA->the_POAManager( );
    rPOAManager->activate( );
    
    // Create child POA
    PortableServer::POA_var pChildPOA =
            pRootPOA->create_POA( "ChildPOA", 
                                  rPOAManager,
                                  policy );

    // Not needed anymore (already copied)
    single->destroy();
    

    // Create an instance of the server
    Util_impl *pTecUtil = new Util_impl;

    // Activate the servant
    Tec::Util_var pTecUtilServant = pTecUtil->_this( );

    // Ouput the reference (TODO)
    CORBA::String_var rObjectString = pORB->object_to_string( pTecUtilServant );
    std::cout << rObjectString << std::endl;

  }
  catch ( CORBA::SystemException_catch& rException )
  {
    rException->_print( std::cerr );
    std::cerr << std::endl;
  }

  // Install a callback for polling the orb
  TecUtilTimerAddCallback( 
      10,
      (ArbParam_t) 0,
      PollORB );

  /*
   * See note on TecUtilLockOn at start of this function.
   */
  TecUtilLockOff();
}
#include "TECADDON.h"
#include "ADDGLBL.h"

#include "CORBA.h"
#include "TecplotCorba.h"
#include "TecplotCorba_impl.h"

//#include "/usr/local/include/mico/orb_mico.h"

#include <iostream>

AddOn_pa AddOnID;

// The ORB
CORBA::ORB_var pORB = NULL;
/**
 */
static void STDCALL MenuCallback(void)
{
  TecUtilLockOn();
  TecUtilLockOff();
}

static Boolean_t PollORB( ArbParam_t pData )
{
  TecUtilLockOn();
  //std::cerr << "DEBUG: Enter PollORB" << std::endl;

  while ( pORB->work_pending( ) )
  {
  std::cerr << "DEBUG: WHILE work_pending" << std::endl;
    pORB->perform_work( );
  std::cerr << "DEBUG: perform_work" << std::endl;
  }

  TecUtilLockOff();

  return TRUE;
}

/**
 * When Tecplot first loads an add-on, it makes a 
 * call to initialize the add-on. This function
 * must be named InitTecAddOn, as shown below.
 */
EXPORTFROMADDON void STDCALL InitTecAddOn(void)
{


  /*
   * NOTE:  TecUtilLockOn MUST be used for InitTecAddOn instead
   *        of TecUtilLockStart because AddonID has yet to be
   *        established.  TecUtilLockOn is in effect an "annonymous"
   *        locking of tecplot (old style).
   */

  TecUtilLockOn();

  /*
   * The function TecUtilAddOnRegister() is the
   * only function that is REQUIRED to be called from
   * the initialization function.
   *
   * The information you give Tecplot by calling
   * this function will show up in the Help/About Add-ons
   * dialog box.
   */

  /*
   * Note that if your add-on requires a specific version of Tecplot,
   * you would check for that here using TecUtilGetTecplotVersion()
   */

  AddOnID = TecUtilAddOnRegister(
      100,
      ADDON_NAME,
      "V"ADDON_VERSION"("TecVersionId") "ADDON_DATE,
      "Genias Graphics GmbH");


  //TecUtilMenuAddOption(
  //    "Tools",
  //    "T-XL",
  //    '\0',
  //    MenuCallback);

  int argc = 1;
  char* argv[] = { "nop" };

  try
  {
    // Get the orb
    pORB = CORBA::ORB_init( argc, argv);

    // Get the root POA
    CORBA::Object_var pRootPOAObj = 
            pORB->resolve_initial_references( "RootPOA" );
    PortableServer::POA_var pRootPOA = 
            PortableServer::POA::_narrow( pRootPOAObj );
    assert(!CORBA::is_nil(pRootPOA));
    
    // Activate the POA manager
    PortableServer::POAManager_var rPOAManager = pRootPOA->the_POAManager( );
    rPOAManager->activate( );
    

    // Create an instance of the server
    Util_impl *pTecUtil = new Util_impl;

    // Activate the servant
    Tec::Util_var pTecUtilServant = pTecUtil->_this( );

    // Ouput the reference (TODO)
    CORBA::String_var rObjectString = pORB->object_to_string( pTecUtilServant );
    std::cout << rObjectString << std::endl;

  }
  catch ( CORBA::SystemException_catch& rException )
  {
    rException->_print( std::cerr );
    std::cerr << std::endl;
  }

  // Install a callback for polling the orb
  TecUtilTimerAddCallback( 
      10,
      (ArbParam_t) 0,
      PollORB );

  /*
   * See note on TecUtilLockOn at start of this function.
   */
  TecUtilLockOff();
}
_______________________________________________
Mico-devel mailing list
[email protected]
http://www.mico.org/mailman/listinfo/mico-devel

Reply via email to