Hi Shan, The case I tried is:
Simple program runs, calls LoadLibrary to load messaging.dll which is linked with qpidclient.dll and qpidcommon.dll. This failed with qpidcommon/client built as static libs because of the TSS issue you refer to. When qpidcommon/client built as DLLs, everything works. Let me know... -Steve -- Steve Huston, Riverace Corporation Check out my networked programming blog at http://stevehuston.wordpress.com/ > -----Original Message----- > From: Shan Wang [mailto:[email protected]] > Sent: Thursday, March 26, 2009 2:18 PM > To: [email protected] > Subject: RE: Exception thrown from qpidcommon.dll on windows > > > Hi Steve, > > Have you explicitly tried to use LoadLibrary() (or other load function > if in another language) to load the DLL which contains qpidcommon.dll > and qpidclient.dll? According to MSDN, TSS should NOT work in > this case. > > I tried the following: > > 1). Test.exe -> MyCppQpidWrapper.dll -> qpidcommon.dll and > qpidclient.dll > In this case everything is fine. > > 2). In a tcl console, Load MyTclQpidWrapper.dll -> > MyCppQpidWrapper.dll > -> qpidcommon.dll and qpidclient.dll > In this case the tcl program crashes. > > I'll try the 0.5 branch, but if the code in AysncIO.cpp is > the same then > I don't expect this problem to go away. > > > Thanks, > Shan > > > > -----Original Message----- > From: Steve Huston [mailto:[email protected]] > Sent: 26 March 2009 17:24 > To: [email protected] > Subject: RE: Exception thrown from qpidcommon.dll on windows > > Hi Shan, > > > Thanks for the reply. > > You're welcome. > > > But this may be a different problem. After searched on > > internet I think > > this problem was from the QPID_TSS declaration in > > AsynchIO.cpp, which is __declspec(thread) on windows. > > Right. > > > MSDN said thread local storage can only work when a dll is > > linked to an > > executable. If loadLibrary() is used to load the dll, an > > system failure > > will occur. And this is exactly what happened in my program. I made > a > > Tcl wrapper of qpid API and tried to load the dll within tcl, > > then I got > > the exception said the program is trying to access memory 0x000000. > > I have seen this happen in a situation where a DLL was built that > included the qpid libs as static, then the DLL was loaded dynamically > at run-time - then this exact crash occurred. > > However, that situation was resolved when qpidclient and qpidcommon > were built as DLLs and linked to the dynamically-loaded DLL. > > > So basically on any windows system prior to Vista, qpid c++ client > can > > not be used as a plugin to another program. > > I don't think this is the case... I tried this scenario with what's on > the 0.5-release branch and it worked. I recommend you try it as well. > > > I had a quick look in your > > JIRA but didn't find a project for this. Now I'm trying to rebuild > the > > client lib without QPID_TSS and assumingly variables like > > threadWriteTotal will only be used by one thread, I will be > > able to get around this issue. > > The TSS usage is in qpidcommon.dll, though, which also runs in the > broker using multiple threads. > > The only way to avoid the __declspec(thread) is the create the TSS > slots as needed at run time. > > But, again, please try this with the 0.5-release branch and let us > know how it goes. > > -Steve > > > -----Original Message----- > > From: Steve Huston [mailto:[email protected]] > > Sent: 26 March 2009 14:41 > > To: [email protected] > > Subject: RE: Exception thrown from qpidcommon.dll on windows > > > > Hi Shan, > > > > You may be seeing the affects of QPID-1550 > > (https://issues.apache.org/jira/browse/QPID-1550) > > > > The QPID-1673 branch has been merged to trunk - I recommend you > either > > switch to trunk, use the 0.5-release branch (which is close to being > > M5), or wait for the 0.5 (M5) release. QPID-1550 is fixed in all of > > those. > > > > -Steve > > > > -- > > Steve Huston, Riverace Corporation > > Check out my networked programming blog at > > http://stevehuston.wordpress.com/ > > > > > > > -----Original Message----- > > > From: Shan Wang [mailto:[email protected]] > > > Sent: Thursday, March 26, 2009 8:32 AM > > > To: [email protected] > > > Subject: Exception thrown from qpidcommon.dll on windows > > > > > > > > > Hi All, > > > > > > > > > > > > I built a client dll from QPID-1673 branch(which I believe is > > > the first > > > usable windows dll branch). In the beginning everything seems > > > fine, then > > > I found this exception thrown somewhere from qpidcommon.dll, and > the > > > call stack is shown below: > > > > > > > > > > > > > > > > > > qpidcommon.dll!qpid::sys::windows::AsynchIO::writeComplete() + > 0x46 > > > bytes C++ > > > > > > qpidcommon.dll!qpid::sys::windows::AsynchIO::completion() + > > > 0x12f bytes > > > C++ > > > > > > qpidcommon.dll!boost::detail::function::void_function_obj_invo > > > ker1<boost > > > ::_bi::bind_t<void,boost::_mfi::mf1<void,qpid::sys::PollableCo > > > nditionPri > > > vate,qpid::sys::AsynchIoResult > > > *>,boost::_bi::list2<boost::_bi::value<qpid::sys::PollableCond > > > itionPriva > > > te *>,boost::arg<1> > >,void,qpid::sys::AsynchIoResult > *>::invoke() > > + > > > 0x10 bytes C++ > > > > > > qpidcommon.dll!boost::function1<void,qpid::sys::Socket const > > > &,std::allocator<boost::function_base> >::operator()() + 0x4e > bytes > > > C++ > > > > > > qpidcommon.dll!qpid::sys::AsynchWriteResult::complete() + 0x18 > > bytes > > > C++ > > > > > > qpidcommon.dll!qpid::sys::AsynchResult::success() + 0x15 bytes > C++ > > > > > > qpidcommon.dll!qpid::sys::Poller::wait() + 0xd3 bytes > C++ > > > > > > qpidcommon.dll!qpid::sys::Poller::run() + 0x29 bytes > C++ > > > > > > qpidclient.dll!qpid::client::TCPConnector::run() + 0x11c bytes > > > C++ > > > > > > msvcr90.dll!785838bb() > > > > > > [Frames below may be incorrect and/or missing, no symbols loaded > > for > > > msvcr90.dll] > > > > > > qpidcommon.dll!`anonymous namespace'::runRunnable() + 0xb bytes > > > C++ > > > > > > > > > > > > > > > > > > Does anyone have a idea what is this about? > > > > > > > > > > > > > > > > > > Thanks and Regards, > > > > > > Shan > > > > > > The information contained in this email is strictly > > > confidential and for the use of the addressee only, unless > > > otherwise indicated. If you are not the intended recipient, > > > please do not read, copy, use or disclose to others this > > > message or any attachment. Please also notify the sender by > > > replying to this email or by telephone (+44 (0)20 7896 0011) > > > and then delete the email and any copies of it. Opinions, > > > conclusions (etc.) that do not relate to the official > > > business of this company shall be understood as neither given > > > nor endorsed by it. IG Index plc is a company registered in > > > England and Wales under number 01190902. VAT registration > > > number 761 2978 07. Registered Office: Friars House, 157-168 > > > Blackfriars Road, London SE1 8EZ. Authorised and regulated by > > > the Financial Services Authority. FSA Register number 114059. > > > > > > > > > > --------------------------------------------------------------------- > > Apache Qpid - AMQP Messaging Implementation > > Project: http://qpid.apache.org > > Use/Interact: mailto:[email protected] > > > > The information contained in this email is strictly > > confidential and for the use of the addressee only, unless > > otherwise indicated. If you are not the intended recipient, > > please do not read, copy, use or disclose to others this > > message or any attachment. Please also notify the sender by > > replying to this email or by telephone (+44 (0)20 7896 0011) > > and then delete the email and any copies of it. Opinions, > > conclusions (etc.) that do not relate to the official > > business of this company shall be understood as neither given > > nor endorsed by it. IG Index plc is a company registered in > > England and Wales under number 01190902. VAT registration > > number 761 2978 07. Registered Office: Friars House, 157-168 > > Blackfriars Road, London SE1 8EZ. Authorised and regulated by > > the Financial Services Authority. FSA Register number 114059. > > > > > --------------------------------------------------------------------- > > Apache Qpid - AMQP Messaging Implementation > > Project: http://qpid.apache.org > > Use/Interact: mailto:[email protected] > > > > > > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:[email protected] > > The information contained in this email is strictly > confidential and for the use of the addressee only, unless > otherwise indicated. If you are not the intended recipient, > please do not read, copy, use or disclose to others this > message or any attachment. Please also notify the sender by > replying to this email or by telephone (+44 (0)20 7896 0011) > and then delete the email and any copies of it. Opinions, > conclusions (etc.) that do not relate to the official > business of this company shall be understood as neither given > nor endorsed by it. IG Index plc is a company registered in > England and Wales under number 01190902. VAT registration > number 761 2978 07. Registered Office: Friars House, 157-168 > Blackfriars Road, London SE1 8EZ. Authorised and regulated by > the Financial Services Authority. FSA Register number 114059. > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:[email protected] > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
