[jira] Created: (AMQCPP-56) GCC warnings and possible SocketFactory bug on 64-bit Linux
GCC warnings and possible SocketFactory bug on 64-bit Linux --- Key: AMQCPP-56 URL: https://issues.apache.org/activemq/browse/AMQCPP-56 Project: ActiveMQ C++ Client Issue Type: Bug Affects Versions: 2.0 Reporter: Albert Strasheim Assigned To: Nathan Mittler Priority: Minor Fix For: 2.0 When compiling on 64-bit Linux with GCC 4.0.3, I see the following warnings: {noformat} activemq/concurrent/PooledThread.cpp:56: warning: 'task$first' may be used uninitialized in this function activemq/concurrent/PooledThread.cpp:56: warning: 'task$second' may be used uninitialized in this function activemq/network/SocketFactory.cpp:46: warning: comparison is always false due to limited range of data type activemq/connector/openwire/marshal/v2/ConnectionControlMarshaller.cpp:82: warning: unused variable 'info' activemq/connector/openwire/marshal/v2/IntegerResponseMarshaller.cpp:60: warning: unused variable 'info' activemq/connector/openwire/marshal/v2/ReplayCommandMarshaller.cpp:61: warning: unused variable 'info' activemq/connector/openwire/marshal/v2/ResponseMarshaller.cpp:60: warning: unused variable 'info' {noformat} The first three warnings probably need to be looked at, especially the one in SocketFactory. In my opinion, AMQCPP is using ints and unsigned ints in places where std::size_t might be more appropriate. MSVC's warning level 3 catches many of these issues, so we might consider upping the warning level and properly dealing with the type conversion issues: mostly use std::size_t and static_cast where we really intend to convert. I can prepare a few patches along these lines if you think this is worthwhile. -- 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
[ 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::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::_Ucopystd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int *(std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _First=(..\src\main\activemq\connector\stomp\StompSessionManager.cpp,254), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Last=(Bad Ptr,14297048), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Ptr=(..\src\main\activemq\connector\stomp\StompSessionManager.cpp,254)) Line 1105 + 0x18 bytes C++ myapp.exe!std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::operator=(const std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,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::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::_Ucopystd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int *(std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _First=(Bad Ptr,-17891602), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Last=(Bad Ptr,-17891602), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Ptr=(Bad Ptr,1886220148)) Line 1105 + 0x18 bytes C++ myapp!std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::operator=(const std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int_Right={...}) Line 582 + 0x1d bytes C++ 0012bf74()
[jira] Closed: (AMQCPP-46) ActiveMQConnection doesn't propagate exception listener to underlying connector
[ 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::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::_Ucopystd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int *(std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _First=(..\src\main\activemq\connector\stomp\StompSessionManager.cpp,254), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Last=(Bad Ptr,14297048), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Ptr=(..\src\main\activemq\connector\stomp\StompSessionManager.cpp,254)) Line 1105 + 0x18 bytes C++ myapp.exe!std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::operator=(const std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,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::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::_Ucopystd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int *(std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _First=(Bad Ptr,-17891602), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Last=(Bad Ptr,-17891602), std::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int * _Ptr=(Bad Ptr,1886220148)) Line 1105 + 0x18 bytes C++ myapp!std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int ::operator=(const std::vectorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int,std::allocatorstd::pairstd::basic_stringchar,std::char_traitschar,std::allocatorchar ,int_Right={...}) Line 582 + 0x1d bytes C++ 0012bf74() myapp.exe!activemq::core::ActiveMQSession::onDestroySessionResource(activemq::core::ActiveMQSessionResource * resource=0x0001) Line 558 + 0x37 bytes C++ msvcr80d.dll!10241a10() ... kernel32.dll!7c812a5b()