You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Alex1 <as...@yahoo.com> on 2013/01/10 03:49:21 UTC

activemq-cpp problem when openssl enabled

activemq-cpp, version 3.4.0
REdhat LInux

Built activemq-cpp with openssl enabled.

The server is configured with openssl enabled. The broker's certificate is
set on client side
with setSystemProperty(). Client test seems working fine when certificate
verification succeeds.

Problem occurred when the certification verification fails, for example, let
client site point to a wrong certificate. Then following exception terminate
the program most of time, but it does not happens every time.

pure virtual method called
terminate called after throwing an instance of 'decaf::io::IOException' 
 
This is only happens when startupMaxReconnectAttempts is set to !=0
There were also other exception:

error:: while accessing OpenSSL library 
error:.... routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

The above errors seen every time (as expected, but it does not abort) The
"pure virtual method called" problem does not happens every time.

I wonder where the exception come from, I could not catch it in my test
code, I am guessing it's deep in library. Any suggestion to avoid the
problem?

Thanks

Alex

Thanks for help,

A



--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-cpp-problem-when-openssl-enabled-tp4661580.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq-cpp problem when openssl enabled

Posted by Timothy Bish <ta...@gmail.com>.
On Fri, 2013-01-11 at 06:50 -0800, Alex1 wrote: 
> Tried 3.5.0.
> 
> It behaved the same.
> 
> 
> pure virtual method called
> terminate called after throwing an instance of
> 'decaf::internal::net::ssl::openssl::OpenSSLSocketException'
> 
> But with 3.5.0, when I removed "failover" URI and added
> "useInactivityMonitor"=false, the frequency of crash is much lower.
> 
> 
> 

I'd recommend adding any insight to the existing issue.  If you are
using Linux you can sometimes get good insight by running a test inside
Valgrind which is good at showing the stack when the error happens.  I
won't have time to look into it for a bit.  

> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/activemq-cpp-problem-when-openssl-enabled-tp4661580p4661657.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: activemq-cpp problem when openssl enabled

Posted by Alex1 <as...@yahoo.com>.
Tried 3.5.0.

It behaved the same.


pure virtual method called
terminate called after throwing an instance of
'decaf::internal::net::ssl::openssl::OpenSSLSocketException'

But with 3.5.0, when I removed "failover" URI and added
"useInactivityMonitor"=false, the frequency of crash is much lower.





--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-cpp-problem-when-openssl-enabled-tp4661580p4661657.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq-cpp problem when openssl enabled

Posted by Timothy Bish <ta...@gmail.com>.
On Thu, 2013-01-10 at 12:37 -0800, Alex1 wrote: 
> Look at the open issue db, and also the stack trace, it looks like very much
> the case AMQCPP-422.
> 
> It traced back from IOTransport->fire
> Transportfilter::fire
> InactivivtyMonitor::OnException
> InactivivtyMonitor::stopMonitorThread
> synchronized()
> decaf::util::concurrent::Lock
> 
> The pure virtual happens when syncObject->lock() called. I am guessing the
> syncObject might be an corrupted pointer.
> 
> 
> 

I'd try it against 3.5.0 since there's a ton of fixes and changes to the
threading in there.  Most likely the issue is that a thread is trying to
run some error handling code but its parent got deleted to early. 

> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/activemq-cpp-problem-when-openssl-enabled-tp4661580p4661633.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: activemq-cpp problem when openssl enabled

Posted by Alex1 <as...@yahoo.com>.
Look at the open issue db, and also the stack trace, it looks like very much
the case AMQCPP-422.

It traced back from IOTransport->fire
Transportfilter::fire
InactivivtyMonitor::OnException
InactivivtyMonitor::stopMonitorThread
synchronized()
decaf::util::concurrent::Lock

The pure virtual happens when syncObject->lock() called. I am guessing the
syncObject might be an corrupted pointer.




--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-cpp-problem-when-openssl-enabled-tp4661580p4661633.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: activemq-cpp problem when openssl enabled

Posted by Timothy Bish <ta...@gmail.com>.
On Wed, 2013-01-09 at 18:49 -0800, Alex1 wrote: 
> activemq-cpp, version 3.4.0
> REdhat LInux
> 
> Built activemq-cpp with openssl enabled.
> 
> The server is configured with openssl enabled. The broker's certificate is
> set on client side
> with setSystemProperty(). Client test seems working fine when certificate
> verification succeeds.
> 
> Problem occurred when the certification verification fails, for example, let
> client site point to a wrong certificate. Then following exception terminate
> the program most of time, but it does not happens every time.
> 
> pure virtual method called
> terminate called after throwing an instance of 'decaf::io::IOException' 
>  
> This is only happens when startupMaxReconnectAttempts is set to !=0
> There were also other exception:
> 
> error:: while accessing OpenSSL library 
> error:.... routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
> 
> The above errors seen every time (as expected, but it does not abort) The
> "pure virtual method called" problem does not happens every time.
> 
> I wonder where the exception come from, I could not catch it in my test
> code, I am guessing it's deep in library. Any suggestion to avoid the
> problem?
> 
> Thanks
> 
> Alex
> 
> Thanks for help,
> 
> A
> 
> 
> 
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/activemq-cpp-problem-when-openssl-enabled-tp4661580.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

I'd recommend moving to a later release like v3.5.0 or at least v3.4.5
to see if the problem has already been resolved. 


-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.fusesource.com | www.redhat.com 
skype: tabish121 | twitter: @tabish121
blog: http://timbish.blogspot.com/