Uploaded image for project: 'ActiveMQ C++ Client'
  1. ActiveMQ C++ Client
  2. AMQCPP-532

Frequently deleting queue browser causes access violation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.8.2
    • Fix Version/s: 3.9.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Windows

      Description

      The following code should reproduce this issue :

      #include <activemq/library/ActiveMQCPP.h>
      #include <activemq/core/ActiveMQConnectionFactory.h>
      #include <activemq/commands/ActiveMQQueue.h>

      using namespace cms;

      int main()
      {
      try
      {
      activemq::library::ActiveMQCPP::initializeLibrary();
      activemq::core::ActiveMQConnectionFactory connectionFactory( "tcp://localhost:61616" );
      auto connection = connectionFactory.createConnection();
      connection->start();
      auto session = connection->createSession( Session::SESSION_TRANSACTED );

      activemq::commands::ActiveMQQueue queue( "testqueue" ); //sometimes it doesn't crash if the queue is empty so it should have atleast a message
      while ( 1 )

      { auto queueBrowser = session->createBrowser( &queue, "" ); auto enumeration = queueBrowser->getEnumeration(); if ( enumeration->hasMoreMessages() ) auto message = enumeration->nextMessage(); delete queueBrowser; }

      }
      catch ( const std::exception& e )

      { std::string what = e.what(); //sometimes it throws an exception like "Monitor is still in use!" }

      while ( 1 ) {} //wait, sometimes an activemq thread fails
      }

        Attachments

        1. crash.cpp
          1 kB
          Andrei Gheorghe
        2. stacktrace.txt
          6 kB
          Andrei Gheorghe

          Activity

            People

            • Assignee:
              tabish121 Timothy Bish
              Reporter:
              andreigheorghe165 Andrei Gheorghe
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: