activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Cooper <n...@ndcooper.com>
Subject Re: ActiveMQ-CPP 2.2 Released
Date Mon, 07 Jul 2008 05:35:22 GMT

Thanks for the release Tim. A lot of work must have gone into it!

Just a couple of points on the use of the APR library...
1. It would be nice if the README.TXT specified which version of the APR
library ActiveMQ-CPP was dependent on. It looks like there are two version
in common use 1.3.2 and 0.9.17.
2. This may or may not be considered a bug….on Windows XP I was getting
"Unhandled exception. Access violation reading location... " when closing my
application. The source of the access violation was the function
apr_allocator_destroy found in apr_pools.c. 

The issue was the APR library was being initialised late in the process of
connecting to the broker. Thus it was one of the first items to be destroyed
when cleaning up the application *before* any of the producers, consumers,
sessions or connections had been destroyed.

The below stack trace points to the fist place the APR library was
initialised. As AprPool uses a static instance of AprRuntime, it will only
be destructed when the application is closed *but* it will be done in the
reverse order of being defined.
>	app.exe!decaf::internal::AprRuntime::AprRuntime()  Line 30	
 	app.exe!decaf::internal::AprPool::getAprPool()  Line 67 + 0x2a	
 	app.exe!decaf::net::TcpSocket::connect()  Line 98 + 0xb	
 	app.exe!decaf::net::SocketFactory::createSocket()  Line 111	
 	app.exe!activemq::transport::filters::TcpTransport::TcpTransport()  Line
60 + 0x7b	
 
app.exe!activemq::transport::filters::TcpTransportFactory::createTransport() 
Line 45 + 0x40	
 	app.exe!activemq::transport::TransportBuilder::createTransport()  Line 105
+ 0x17	
 	app.exe!activemq::transport::TransportBuilder::buildTransport()  Line 56 +
0xa3	
 	app.exe!activemq::core::ActiveMQConnectionFactory::createConnection() 
Line 127 + 0x10	
 	app.exe!activemq::core::ActiveMQConnectionFactory::createConnection() 
Line 67 + 0x65	
	app.exe!<call to active mq library> 

My application uses ActiveMQ-CPP library ONLY as a MOM client library, it
does not use any of the decaf functionality unlike the example provided with
the release. As the HelloWorldConsumer uses a CountDownLatch as a member
variable which is initialised in the constructor, the APR library is
initialised in the correct order.

So after all that rambling as a quick fix I have added the following lines
into my application, which has resolved the issue.
#include <decaf/internal/AprRuntime.h>
decaf::internal::AprRuntime gAprRuntime;

-- 
View this message in context: http://www.nabble.com/ActiveMQ-CPP-2.2-Released-tp18055195p18310319.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message