Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-13-2007
jans jans is offline
Registered User
 
Name: Jans Zhang
Organization: DongFang Uniniverty
Project: just learn ice
 
Join Date: Jul 2007
Location: China
Posts: 2
ICE in COM DLL Server can not exit??

I use ice in a COM dll server.It worked well.
But when It exit,it blocked at the Ice::Communicator "destory" method
infinitely!


this is the call stack:

IceUtil::ThreadControl::join() line 50
IceInternal::ThreadPool::joinWithAllThreads() line 349 + 46 bytes
IceInternal::Instance::destroy() line 936
Ice::CommunicatorI::destroy() line 74 + 21 bytes
CCommunicator::Uninit() line 55 + 47 bytes
CSeurityInfoApp::ExitInstance() line 84
DllMain(HINSTANCE__ * 0x10000000, unsigned long 0, void * 0x00000000) line 139
_DllMainCRTStartup(void * 0x10000000, unsigned long 0, void * 0x00000000) line 273 + 17 bytes
NTDLL! 7c94a352()
NTDLL! 7c969dee()
KERNEL32! 7c82b1bb()

the demo project
in the demo project.
CServer is listen on tcp port 10000
CClient is normal client in normal way access cserver.
SeurityInfo is the COM dll server.the dll wrapper the CClient in COM way. encounter the problem that mentioned earlier!!!
Test_SecurityInfo is the C++ Client call the COM dll server.

CServer <===> CClient work well. you can use it test the server service.
CServer <===> SeurityInfo has problem. When SeurityInfo exit,it blocked.

My C++ Developer tool is MS VC++6.0 + SP6.

Hope for help.
Thanks for your attention.
Attached Files
File Type: zip project.zip (552.5 KB, 50 views)
__________________
Jans.C++ Programer.

Last edited by jans : 07-13-2007 at 05:20 AM.
Reply With Quote
  #2 (permalink)  
Old 07-17-2007
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
I looked into your problem, and your example does indeed hang. The problem is that you are attempted to destroy the communicator in the DLL_PROCESS_DETACH notification on the COM object. Destroying the communicator destroys and joins with the threads that it created. The problem is that joining with threads in the DLL_PROCESS_DETACH notification is illegal.

DllMain (Windows)

"Because DLL notifications are serialized, entry-point functions should not attempt to communicate with other threads or processes. Deadlocks may occur as a result."

You are seeing a deadlock, as the documentation says. Therefore, what you must do instead is arrange to destroy the communicator before this notification occurs.
Reply With Quote
  #3 (permalink)  
Old 07-17-2007
jans jans is offline
Registered User
 
Name: Jans Zhang
Organization: DongFang Uniniverty
Project: just learn ice
 
Join Date: Jul 2007
Location: China
Posts: 2
Thanks a lot for your quick response.
I will thank you again when I resolve the problem.
Thank you and all the other staff.
__________________
Jans.C++ Programer.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
use ice in dll? cool stone Help Center 4 05-23-2007 07:52 AM
Traditional DLL being loaded by .NET DLL - Unable to Find dependencies mboozell Help Center 3 05-02-2007 10:51 AM
Caught an unknown Exception and program exit! Yunqiao Yin Help Center 11 10-31-2006 08:37 AM
Error message on "run" exit Larry Help Center 10 07-13-2006 01:54 PM
how to pack a server to a dll simpley Help Center 4 01-13-2005 04:06 AM


All times are GMT -4. The time now is 11:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.