[omniORB] OmniORB 2.7.1 (fwd)

David Riddoch djr@uk.research.att.com
Tue, 20 Jul 1999 14:21:32 +0100 (GMT)



---------- Forwarded message ----------
Date: Thu, 15 Jul 1999 18:55:38 +0200
From: Axel Fix <fix@iff.fhg.de>
To: djr@uk.research.att.com
Subject: OmniORB 2.7.1

Hallo,

I want to report you my problem and hope you can help.
I have wrote a CS-Application and first both was a console appl.
In the second step I change the C to a DLL loading at runtime.
And know the C (particularly the appl that load the DLL) hangs
up at the call FreeLibrary().
I work with MSVC++ 6.0.


More specificly.........
######################################################
Application code:
...
  HINSTANCE  mi = ::LoadLibrary(dll);
  if (mi == NULL)
  { ...   error
    return;
  }
  Tfn  fn = (Tfn)GetProcAddress(mi, "function");
  if (fn == NULL)
  { ...   error
    ::FreeLibrary(mi);
    return;
  }
  try
  { 
    fn(x,y,z);
  }
  catch (CcapThrowObj to)
  { .... error
    ::FreeLibrary(mi);  return;  // here it can hang up to
  }
  ::FreeLibrary(mi);  // here it hangs up

######################################################
client code:
__declspec(dllexport)
void  fn(const int& x, const int& y, int z)
{ char *argv[] = {"application", NULL};  // I think, it's not
interesting
  int   argc   = 1;

  CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv,"omniORB2");
  CORBA::BOA_ptr boa = orb->BOA_init(  argc, argv,"omniORB2_BOA");
  CORBA::Object_var obj;
  ...
  // working with the remote object //
  ...
}  // end of function


####################################################
It's possible, that some debug infos are helpful...
There are two omni threads still working after FreeLibrary():
1. omni_thread_wrapper()
    --> omni_thread::exit()
        --> _endthreadex(0);  // nt.cc  line 757
2. OutScavengerThreadKiller::~OutScavengerThreadKiller()
   --> StrandScavenger::killOutScavenger()
       --> outScavenger->join(0);  // scavenger.cc  line 168

It seems to me that the scavenger is waiting to the end of 
omni_thread_wrapper, but I don't know.

I hope that helps to find the problem.

Thanks,
Axel
-- 
 ______________________________________________
|   __    _  _  ____  __      ____  ____  _  _ |
|  /__\  ( \/ )( ___)(  )    ( ___)(_  _)( \/ )|
| /(__)\  )  (  )__)  )(__    )__)  _)(_  )  ( |
|(__)(__)(_/\_)(____)(____)  (__)  (____)(_/\_)|
|					       |
|   E-Mail:  fix@iff.fhg.de                    |
|   Tel.:    (0391) 4090 242		       |
|   FAX:     (0391) 4090 596		       |
|   Anschr.: Sandtorstr. 22                    |
|   	     39106 Magdeburg		       |
|______________________________________________|