You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Albert Strasheim (JIRA)" <ji...@apache.org> on 2007/01/17 15:27:49 UTC

[jira] Created: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

ActiveMQConnection doesn't propagate exception listener to underlying connector
-------------------------------------------------------------------------------

                 Key: AMQCPP-46
                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
             Project: ActiveMQ C++ Client
          Issue Type: Bug
    Affects Versions: 1.1
            Reporter: Albert Strasheim
         Assigned To: Nathan Mittler
             Fix For: 2.0
         Attachments: amqconn-exlistener.diff

My program is doing the following:

# Create connection using ActiveMQConnectionFactory
# Set a simple exception listener that sets a boolean flag
# Block in receive on consumer

If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.

If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.

Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.

Stack trace (with useless bits stripped out):
{noformat}
 	kernel32.dll!7c812a5b() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	kernel32.dll!7c812a5b() 	
>	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
 	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
 	0012b920()	
 	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
 	msvcr80d.dll!102418b7() 	
        ...	
 	kernel32.dll!7c812a5b() 	
 	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
 	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
 	0012bf74()	
 	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
 	msvcr80d.dll!10241a10() 	
        ...	
 	kernel32.dll!7c812a5b() 	
 	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
 	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37932 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

Committed a fix for the exception listener to trunk and added unit tests to verify.  Will look into the producer destruction next.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37999 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

I did an svn update and got the fix you made to Set.h. I cleaned my solution (release and debug) and did a batch build.

Still seeing the crash though. Here's how to reproduce it (I hope):

1. Don't run the broker yet.
2. Run the code I provided. It keeps trying to connect to the broker. It prints:

Got an exception: Socket::connect - A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.

3. Start the broker. The program stops printing.
4. Ctrl-C the broker or Close the command prompt window in which it runs.
5. Wait about 3 seconds.
6. Crash happens.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37988 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Nathan - Will do. I'll check out the current state of affairs and then make a new issue.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37994 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

sure thing - grab trunk!

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38005 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

I noticed the following issue. Don't know if it qualifies as an issue in AMQCPP, but I thought I'd mention it.

In  most cases when I shut down the broker and the exception listener fires properly and I can clean up everything (without deletes throwing exceptions), the stack trace that gets printed on the console looks like this:

{noformat}
WARNING: activemq::io::SocketInputStream::read - The connection is broken
        FILE: ..\src\main\activemq\network\SocketInputStream.cpp, LINE: 137
        FILE: ..\src\main\activemq\io\BufferedInputStream.cpp, LINE: 199
        FILE: ..\src\main\activemq\io\BufferedInputStream.cpp, LINE: 83
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 216
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 120
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 71
        FILE: ..\src\main\activemq\transport\IOTransport.cpp, LINE: 175
{noformat}

The message is printed twice with different tids, from the two threads that are active.

Sometimes when I shut down the broker and the exception handler fires and I clean up everything but then the consumer's destructor throws an exception. In that case, the stack trace that is printed looks like this:

{noformat}
WARNING: activemq::io::SocketInputStream::read - An existing connection was forc
ibly closed by the remote host.

        FILE: ..\src\main\activemq\network\SocketInputStream.cpp, LINE: 145
        FILE: ..\src\main\activemq\io\BufferedInputStream.cpp, LINE: 199
        FILE: ..\src\main\activemq\io\BufferedInputStream.cpp, LINE: 83
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 216
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 120
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 71
        FILE: ..\src\main\activemq\transport\IOTransport.cpp, LINE: 175
{noformat}

Again I see this message from both threads. Note the slightly different line numbers in SocketInputStream.cpp. In this case the failure of the socket is probably being detected in a slightly different place.

Should consumers' (and producers' and sessions') destructors be excepted to throw if the underlying connection is broken or did you intend to catch all these exceptions?

For now, I'll wrap cleanup of all my producers, consumers and sessions in a function that ignores any CMS exceptions.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp, purify-example.txt
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37981 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Running the crashing program repeatedly sometimes makes it crash with the following stack:

{noformat}
>	vs2005-activemq-example.exe!activemq::core::ActiveMQSession::getAcknowledgeMode()  Line 465 + 0x17 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::dispatch(activemq::core::ActiveMQMessage * message=0x00b42428)  Line 395 + 0x19 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::onActiveMQMessage(activemq::core::ActiveMQMessage * message=0x00b42428)  Line 449 + 0x1b bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::onConsumerMessage(activemq::connector::ConsumerInfo * consumer=0x00b40af0, activemq::core::ActiveMQMessage * message=0x00b42428)  Line 196	C++
 	vs2005-activemq-example.exe!activemq::connector::stomp::StompSessionManager::onStompCommand(activemq::connector::stomp::commands::StompCommand * command=0x00b410d0)  Line 329	C++
 	vs2005-activemq-example.exe!activemq::connector::stomp::StompConnector::onCommand(activemq::transport::Command * command=0x00b410d4)  Line 781	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::fire(activemq::transport::Command * command=0x00b410d4)  Line 88	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::onCommand(activemq::transport::Command * command=0x00b410d4)  Line 168	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::fire(activemq::transport::Command * command=0x00b410d4)  Line 88	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::onCommand(activemq::transport::Command * command=0x00b410d4)  Line 127	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::fire(activemq::transport::Command * command=0x00b410d4)  Line 125 + 0x17 bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::run()  Line 161	C++
 	vs2005-activemq-example.exe!activemq::concurrent::Thread::runCallback(void * param=0x0035f2f8)  Line 152 + 0x13 bytes	C++
 	msvcr80d.dll!102047c1() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr80d.dll]	
 	msvcr80d.dll!10204767() 	
 	kernel32.dll!7c80b683() 	
{noformat}

Seems the threads are stepping on each other when shutting down.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim reopened AMQCPP-46:
------------------------------------


> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37930 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

> There does appear to be a disconnect on the listener chain.

If I understand this correctly, you agree that there is an issue with ActiveMQConnection?

Here's some code to reproduce the problem with exceptions I'm seeing (after applying my patch). You can paste this code over the stuff in vs2005-activemq-example -- it's probably the quickest way to get it building.

{noformat}
#include <activemq/core/ActiveMQConnectionFactory.h>
#include <cms/ExceptionListener.h>
#include <cms/Session.h>
#include <iostream>

struct ExceptionListener : public cms::ExceptionListener {
    bool error;

    ExceptionListener() : error(false) {}

    virtual ~ExceptionListener(void) {}
   
    virtual void onException( const cms::CMSException& ex ) {
        std::cout << "Got an exception in listener: " << ex.getMessage() << std::endl;
        error = true;
    }
};
    
int main(int argc, char* argv[]) {
    ExceptionListener exListener;
    activemq::core::ActiveMQConnectionFactory* connectionFactory =
        new activemq::core::ActiveMQConnectionFactory("tcp://127.0.0.1:61613");
    while (true) {
        cms::Connection* connection = 0;
        cms::Session* session = 0;
        cms::Destination* destination = 0;
        cms::MessageConsumer* consumer = 0;
        try {
            while (!exListener.error) {
                connection = connectionFactory->createConnection();
                connection->setExceptionListener(&exListener);
                session = connection->createSession( cms::Session::AUTO_ACKNOWLEDGE );
                destination = session->createTopic( "TEST.FOO" );
                consumer = session->createConsumer( destination );
                connection->start();
                cms::Message* message = consumer->receive(10000);
                delete message;
                message = 0;
            }
        } catch ( cms::CMSException& ex ) {
            std::cout << "Got an exception: " << ex.getMessage() << std::endl;
        }
        delete consumer;
        consumer = 0;
        delete destination;
        destination = 0;
        delete session;
        session = 0;
        delete connection;
        connection = 0;
        exListener.error = false;
    }
    delete connectionFactory;
    connectionFactory = 0;
    return 0;
}
{noformat}

Use it as follows:

Compile in debug mode in Visual Studio and run the program (without a running broker).

You should see: Got an exception: Socket::connect - No error as it retries the createConnection part.

Start the broker. It should establish a connection and block on receive.

Kill the broker. You should see:

WARNING: activemq::io::SocketInputStream::read - An existing connection was forcibly closed by the remote host.
        FILE: ..\src\main\activemq\network\SocketInputStream.cpp, LINE: 171
        FILE: ..\src\main\activemq\io\BufferedInputStream.cpp, LINE: 158
        FILE: ..\src\main\activemq\io\BufferedInputStream.cpp, LINE: 81
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 216
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 120
        FILE: ..\src\main\activemq\connector\stomp\StompCommandReader.cpp, LINE: 71
        FILE: ..\src\main\activemq\transport\IOTransport.cpp, LINE: 165
 - tid: 7252
Got an exception in listener: activemq::io::SocketInputStream::read - An existing connection was forcibly closed by the remote host.

Then the application crashes. I get this dialog box:

{noformat}
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Error!

Program: ...

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

(Press Retry to debug the application)
---------------------------
Abort   Retry   Ignore   
---------------------------
{noformat}

If I debug in Visual Studio, my stack looks like this:

{noformat}
 	msvcr80d.dll!10202b13() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr80d.dll]	
 	ntdll.dll!7c96d886() 	
...
 	kernel32.dll!7c812a5b() 	
>	vs2005-activemq-example.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\network\SocketOutputStream.cpp",85), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,3473888), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\network\SocketOutputStream.cpp",85))  Line 1105 + 0x18 bytes	C++
 	vs2005-activemq-example.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
 	0012de6c()	
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 144 + 0x37 bytes	C++
 	msvcr80d.dll!10243137() 	
...
 	msvcr80d.dll!10243990() 	
 	vs2005-activemq-example.exe!activemq::network::SocketOutputStream::write(const unsigned char * buffer=0x0035d358, int len=83)  Line 89	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::emptyBuffer()  Line 76	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::flush()  Line 86	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::close()  Line 67	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 141	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::~IOTransport()  Line 48	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::~TransportFilter()  Line 115 + 0x23 bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TcpTransport::~TcpTransport()  Line 72 + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TcpTransport::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::~TransportFilter()  Line 115 + 0x23 bytes	C++
 	msvcr80d.dll!10243137() 	
...
 	kernel32.dll!7c812a5b() 	
 	vs2005-activemq-example.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\network\SocketOutputStream.cpp",85), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,3473816), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\network\SocketOutputStream.cpp",85))  Line 1105 + 0x18 bytes	C++
 	vs2005-activemq-example.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
 	0012f1a0()	
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 144 + 0x37 bytes	C++
 	msvcr80d.dll!10243137() 	
...
 	msvcr80d.dll!10243990() 	
 	vs2005-activemq-example.exe!activemq::network::SocketOutputStream::write(const unsigned char * buffer=0x0035d358, int len=83)  Line 89	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::emptyBuffer()  Line 76	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::flush()  Line 86	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::close()  Line 67	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 141	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::close()  Line 226	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::close()  Line 363	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::~ResponseCorrelator()  Line 120	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnectionData::close()  Line 123 + 0x38 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnectionData::~ActiveMQConnectionData()  Line 77	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnectionData::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::close()  Line 107 + 0x26 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::~ActiveMQConnection()  Line 49 + 0xb bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!main(int argc=1, char * * argv=0x00356078)  Line 49 + 0x34 bytes	C++
 	vs2005-activemq-example.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	vs2005-activemq-example.exe!mainCRTStartup()  Line 403	C
 	kernel32.dll!7c816fd7() 	
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=(<Bad Ptr>,119), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=("",HEADER_DESTINATION))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=(<Bad Ptr>,119), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=("",HEADER_DESTINATION))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=(<Bad Ptr>,119), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=("",HEADER_DESTINATION))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=(<Bad Ptr>,119), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=("",HEADER_DESTINATION))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=("÷",-503724384), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=("",HEADER_DESTINATION))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=("÷",-503724384), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=("‹@",-511349080))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=("÷",-503724384), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=(<Bad Ptr>,394))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=("÷",-503724384), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=(<Bad Ptr>,394))  Line 918 + 0x9e bytes	C++
 	vs2005-activemq-example.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::erase(std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _First=("÷",-503724384), std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,enum activemq::connector::stomp::commands::CommandConstants::StompHeader,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,enum activemq::connector::stomp::commands::CommandConstants::StompHeader> >,0> >::iterator _Last=(<Bad Ptr>,394))  Line 918 + 0x9e bytes	C++
{noformat}

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37997 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Still seeing a crash on Windows when running the example I provided on 17 Jan.

Stack looks like this:

{noformat}
 	msvcr80d.dll!10202b13() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr80d.dll]	
 	msvcr80d.dll!1021866b() 	
...	
 	kernel32.dll!7c812a5b() 	
>	vs2005-activemq-example.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=0xe06d7363, std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=0x00000001, std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=0x00000003)  Line 1105 + 0x18 bytes	C++
 	msvcr80d.dll!10243990() 	
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 145 + 0x37 bytes	C++
 	msvcr80d.dll!102418b7() 	
...
 	msvcr80d.dll!10243990() 	
 	vs2005-activemq-example.exe!activemq::network::SocketOutputStream::write(const unsigned char * buffer=0x00b73af8, int len=83)  Line 90 + 0x58 bytes	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::emptyBuffer()  Line 76	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::flush()  Line 86	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::close()  Line 67	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 142	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::~IOTransport()  Line 49	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::~TransportFilter()  Line 115 + 0x23 bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TcpTransport::~TcpTransport()  Line 72 + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TcpTransport::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::~TransportFilter()  Line 115 + 0x23 bytes	C++
 	msvcr80d.dll!10243137() 	
...
 	kernel32.dll!7c812a5b() 	
 	vs2005-activemq-example.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=0xe06d7363, std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=0x00000001, std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=0x00000003)  Line 1105 + 0x18 bytes	C++
 	msvcr80d.dll!10243990() 	
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 145 + 0x37 bytes	C++
 	msvcr80d.dll!102418b7() 	
...
 	msvcr80d.dll!10243990() 	
 	vs2005-activemq-example.exe!activemq::network::SocketOutputStream::write(const unsigned char * buffer=0x00b73af8, int len=83)  Line 90 + 0x58 bytes	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::emptyBuffer()  Line 76	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::flush()  Line 86	C++
 	vs2005-activemq-example.exe!activemq::io::BufferedOutputStream::close()  Line 67	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::close()  Line 142	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::close()  Line 224	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::close()  Line 259	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::~ResponseCorrelator()  Line 61	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnectionData::close()  Line 123 + 0x38 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnectionData::~ActiveMQConnectionData()  Line 77	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnectionData::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::close()  Line 133 + 0x38 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::~ActiveMQConnection()  Line 51 + 0xb bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::`scalar deleting destructor'()  + 0xf bytes	C++
 	vs2005-activemq-example.exe!main(int argc=1, char * * argv=0x003560a8)  Line 49 + 0x34 bytes	C++
 	vs2005-activemq-example.exe!__tmainCRTStartup()  Line 586 + 0x19 bytes	C
 	vs2005-activemq-example.exe!mainCRTStartup()  Line 403	C
 	kernel32.dll!7c816fd7() 	
{noformat}




> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-46:
-----------------------------------

    Attachment: purify-example.txt

Purify output after letting the example I provided reconnect a few times (i.e. I start and stop the broker). This is when running on Windows. Shows a few possible memory leaks, but many of these might be false positives. I'll comment now with what Valgrind says.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp, purify-example.txt
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37983 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

I've cleaned up a couple of items that you might want to grab from trunk.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Albert Strasheim updated AMQCPP-46:
-----------------------------------

    Attachment: main.cpp

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38004 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Example looks good on Windows and Linux for me.

Valgrind reports the following memory leak (only one, in contrast to all those reported by Purify, which might all be from this one leak):

{noformat}
==15493== 149,520 (89,712 direct, 59,808 indirect) bytes in 1,869 blocks are definitely lost in loss record 55 of 55
==15493==    at 0x4A19DE3: operator new(unsigned long) (vg_replace_malloc.c:168)
==15493==    by 0x45DEDD: activemq::network::SocketFactory::createSocket(activemq::util::Properties const&) (SocketFactory.cpp:96)
==15493==    by 0x458D0C: activemq::transport::TcpTransport::TcpTransport(activemq::util::Properties const&, activemq::transport::Transport*, bool) (TcpTransport.cpp:42)
==15493==    by 0x42B3EE: activemq::transport::TcpTransportFactory::createTransport(activemq::util::Properties const&) (TcpTransportFactory.cpp:55)
==15493==    by 0x404CC0: activemq::core::ActiveMQConnectionFactory::createConnection(std::string const&, std::string const&, std::string const&) (ActiveMQConnectionFactory.cpp:130)
==15493==    by 0x4042D5: activemq::core::ActiveMQConnectionFactory::createConnection() (ActiveMQConnectionFactory.cpp:69)
==15493==    by 0x403D67: main (main.cpp:30)
{noformat}

This leak happens when I start and stop the broker repeatedly, causing the example to reconnect a few times. I do a delete connection in the example, so it would seem that something isn't cleaning up properly in its destructor?

Thanks very much for sorting out this issue. It's been a tough one! :-)

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp, purify-example.txt
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Mittler closed AMQCPP-46.
--------------------------------

    Resolution: Fixed

The example seems to be working fine now on OS X.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37978 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

I found some issues with closing a consumer when there is a broken socket to the broker.  Patch has been applied to trunk.

I don't have a good environment to test the changes right now ... fancy giving it a whirl?

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37989 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

Albert,
I've made some updates to trunk to do the automatic closing of comsumers and producers when you close the session.  Could you give that a try?

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37980 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Think I've found a crash. In the code I'll attach the crash happens if consumer2 is not closed before it is deleted (seems like this should be possible?).

Stack looks like this:

{noformat}
>	vs2005-activemq-example.exe!activemq::core::ActiveMQSession::getAcknowledgeMode()  Line 465 + 0x17 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::dispatch(activemq::core::ActiveMQMessage * message=0x00b42428)  Line 395 + 0x19 bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConsumer::onActiveMQMessage(activemq::core::ActiveMQMessage * message=0x00b42428)  Line 449 + 0x1b bytes	C++
 	vs2005-activemq-example.exe!activemq::core::ActiveMQConnection::onConsumerMessage(activemq::connector::ConsumerInfo * consumer=0x00b40af0, activemq::core::ActiveMQMessage * message=0x00b42428)  Line 196	C++
 	vs2005-activemq-example.exe!activemq::connector::stomp::StompSessionManager::onStompCommand(activemq::connector::stomp::commands::StompCommand * command=0x00b410d0)  Line 329	C++
 	vs2005-activemq-example.exe!activemq::connector::stomp::StompConnector::onCommand(activemq::transport::Command * command=0x00b410d4)  Line 781	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::fire(activemq::transport::Command * command=0x00b410d4)  Line 88	C++
 	vs2005-activemq-example.exe!activemq::transport::ResponseCorrelator::onCommand(activemq::transport::Command * command=0x00b410d4)  Line 168	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::fire(activemq::transport::Command * command=0x00b410d4)  Line 88	C++
 	vs2005-activemq-example.exe!activemq::transport::TransportFilter::onCommand(activemq::transport::Command * command=0x00b410d4)  Line 127	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::fire(activemq::transport::Command * command=0x00b410d4)  Line 125 + 0x17 bytes	C++
 	vs2005-activemq-example.exe!activemq::transport::IOTransport::run()  Line 161	C++
 	vs2005-activemq-example.exe!activemq::concurrent::Thread::runCallback(void * param=0x0035f2f8)  Line 152 + 0x13 bytes	C++
 	msvcr80d.dll!102047c1() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for msvcr80d.dll]	
 	msvcr80d.dll!10204767() 	
 	kernel32.dll!7c80b683() 	
{noformat}

Crash happens because the connector resource inside the session's sessionInfo is invalid.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37998 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

hm ... I'm not getting that same stack trace in msvc, but I did find one bug in the new code (for the propagation of close to child resources).  I recommend giving it a try again with the latest trunk.  Do a "make clean all" of amq-cpp just to make sure any bugs we find are really from the latest code.

Thanks!

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38011 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

The memory leak an uncaught exception issues have been split out to AMQCPP-58 and AMQCPP-59, respectively.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp, purify-example.txt
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37929 ] 

Timothy Bish commented on AMQCPP-46:
------------------------------------

There does appear to be a disconnect on the listener chain.

> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.

This is fine, Producer traps all exceptions in its dtor an will allow cleanup to continue.  The exception mechanism appears to be handling the errors as intended.  

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38006 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

The destructor of the consumer should not throw an exception, if it is this is an error.  At this point, I think we've exhausted this issue. 

If you wouldn't mind, let's create two new issues:  

1) consumer detor throwing exception
2) valgrind/purify output

Thanks again for all your help!

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp, purify-example.txt
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37987 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

I realise that C++ isn't Java but it seems that close and the destructor have different responsibilities. Closing a consumer prevents it from receiving any more messages. Closing a session prevents all its consumers from receiving any more messages. Closing a connection prevents all its sessions from receiving any more messages. Deleting consumers, sessions and connections (in that order), free the resources allocated for these objects.

Are there data structures inside a session that can only be deleted by close (i.e. can't be left over until the destructor is called)?

I'm asking about these issues with a view to the Python wrappers I'm working on. Boost.Python makes it very easy to control object lifetimes (e.g. keeping a reference to a session as long as any consumers made from it are still referenced), but it becomes a lot harder to enforce close order with the library as it is currently. If close on a session must delete stuff that invalidates consumers made from it, it would be very useful if the consumers could at least throw an IllegalStateException when you try to close them instead of crashing randomly.

Thanks again.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Mittler closed AMQCPP-46.
--------------------------------

    Resolution: Fixed

This has been fixed in trunk

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp, purify-example.txt
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37986 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

Albert - you are correct.  Looking at the JMS 1.1 spec, it specifically says in the documentation on Session.close:

"There is no need to close the producers and consumers of a closed session."

This, however, sounds like a new issue to me.  Could you create one?

Also, could you indicate whether or not the current code works properly when explicitly closing consumers before closing the session?

Thanks!

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37979 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Will do.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38002 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

Ok, I think I've finally got it.  It seems that windows is a little pickier than OS X about multiple attempts to write on a closed socket.  Everything seems to be working properly now - give it a shot and let me know.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Timothy Bish (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37985 ] 

Timothy Bish commented on AMQCPP-46:
------------------------------------

C++ isn't Java so if you close something and it deletes pointers that would be needed for a later operation on a child object then there no way to use that object any longer.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37992 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

Thanks very much. I'll try it out in our application tomorrow. According to page 57 of the 1.1 spec, closing a connection should also cause consumers to close (and those blocking on receive to return null or a message). Will it be possible to add this as well?

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Albert Strasheim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37984 ] 

Albert Strasheim commented on AMQCPP-46:
----------------------------------------

I don't know if this would be hard to implement, but it seems to me that one might want to support closing of a session without having to close all its consumers beforehand and closing of a connection without having to close all its sessions beforehand.

I accept that one has to delete all the stuff you make in the reverse order since data belonging to a session is shared by its consumers, etc. As you noted, destruction will close the object being destroyed, but if it so happens that the parent (be it a session for a consumer or a connection for a session) has been closed, close in the destructor does nothing.

As far as I remember the JMS specification doesn't say anything about the order in which one has to close stuff (I could be wrong here), so I'm thinking the C++ implementation shouldn't impose a restriction either?

Are there fundamental reasons why "close session to close all consumers" and "close connection to close all sessions (which closes all consumers)" can't or shouldn't work?

Thanks!

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector

Posted by "Nathan Mittler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQCPP-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_37982 ] 

Nathan Mittler commented on AMQCPP-46:
--------------------------------------

at first glance it looks like the problem is in your main ... the consumers should be closed (either explicitly or implicitly through the destructor) before closing the session.

> ActiveMQConnection doesn't propagate exception listener to underlying connector
> -------------------------------------------------------------------------------
>
>                 Key: AMQCPP-46
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-46
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>    Affects Versions: 1.1
>            Reporter: Albert Strasheim
>         Assigned To: Nathan Mittler
>             Fix For: 2.0
>
>         Attachments: amqconn-exlistener.diff, main.cpp
>
>
> My program is doing the following:
> # Create connection using ActiveMQConnectionFactory
> # Set a simple exception listener that sets a boolean flag
> # Block in receive on consumer
> If I then kill the broker, various exceptions happen, but they are never sent to the exception listener, because the exception listener in StompConnector is null. It seems to me that ActiveMQConnection should set and get its exception listener on its underlying connector and probably doesn't have to contain a pointer to the listener itself.
> If I change ActiveMQConnection as in the attached patch to also set the exception listener on the underlying connector, my exception listener gets called when the broker dies.
> Once I detect the failure, I delete the producer, consumer, session and connection that failed. Looks like an uncaught exception is getting thrown during the destruction of the producer (which is the first thing I delete when cleaning up). The problem here is probably that the connection is trying to close down a socket that is already broken and something goes awry. I'm not quite sure how to fix this problem.
> Stack trace (with useless bits stripped out):
> {noformat}
>  	kernel32.dll!7c812a5b() 	
>  	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
>  	kernel32.dll!7c812a5b() 	
> >	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,14297048), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("..\src\main\activemq\connector\stomp\StompSessionManager.cpp",254))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012b920()	
>  	myapp.exe!activemq::core::ActiveMQConsumer::close()  Line 84 + 0x34 bytes	C++
>  	msvcr80d.dll!102418b7() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=(<Bad Ptr>,1886220148))  Line 1105 + 0x18 bytes	C++
>  	myapp!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
>  	0012bf74()	
>  	myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x00000001)  Line 558 + 0x37 bytes	C++
>  	msvcr80d.dll!10241a10() 	
>         ...	
>  	kernel32.dll!7c812a5b() 	
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::_Ucopy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> *>(std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _First=(<Bad Ptr>,1886220148), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Last=(<Bad Ptr>,-17891602), std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> * _Ptr=("<<U",4832632))  Line 1105 + 0x18 bytes	C++
>  	myapp.exe!std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > >::operator=(const std::vector<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,int> > > & _Right={...})  Line 582 + 0x1d bytes	C++
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.