activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Bish (JIRA)" <>
Subject [jira] Commented: (AMQCPP-330) Unable to reinitialize ActiveMQ CMS library and then open a session
Date Fri, 19 Nov 2010 21:15:25 GMT


Timothy Bish commented on AMQCPP-330:

This particular use case isn't really supported by ActiveMQ-CPP, you are welcome to provide
a patch for this particular problem but I can't guarantee that everything will work the second
time.  Calling the startup method when your application starts and then ensuring that shutdown
gets called once when your program exits is the intended use case.  You can register a method
with the atexit method defined in stdlib.h

> Unable to reinitialize ActiveMQ CMS library and then open a session
> -------------------------------------------------------------------
>                 Key: AMQCPP-330
>                 URL:
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>          Components: Decaf
>    Affects Versions: 3.2.3
>         Environment: Windows XP SP2
>            Reporter: Evan Kuhn
>            Assignee: Timothy Bish
>            Priority: Minor
>         Attachments: multi_init_test_main.cpp
> I'm working on a project that initializes and shuts down the ActiveMQ CMS library multiple
times.  After upgrading from CMS 3.1.3 to 3.2.3, I noticed that my process crashes after these
> 1) Initialize ActiveMQ CMS library
> 2) Create connection, session, etc and do work
> 3) Shut down ActiveMQ CMS library
> 4) Initialize ActiveMQ CMS library a second time
> 5) Create a connection, then a session... crash
> First off, am I allowed to reinitialize the CMS library after shutting it down?  Is it
recommended not to?
> Either way, the program crashes at:
>     /main/activemq/transport/tcp/TcpTransport.cpp line 163
> I believe the error is in  /main/decaf/net/SocketFactory.cpp.  The static SocketFactory::defaultFactory
pointer (line 30) is set while creating the first session.  Then when shutting down the library,
the Network object destroys the object pointed to by SocketFactory::defaultFactory.  The next
time around, SocketFactory::getDefault() will try to use the pointer, but the factory object
has been destroyed, so the process crashes.
> One possible fix is to modify the SocketFactory destructor to set the defaultFactory
pointer to NULL.  I have no idea if that's a good solution, though.
> I will attach a test program to reproduce the crash.

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

View raw message