Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

View: New views
6 Messages — Rating Filter:   Alert me  

Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

by andrewdc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am newbie on acticemq CMS API. I have compiled ActiveMQ CMS v3.0.1 source in Visual C++ 2005 Express. I am following the CMS examples developing queue producers and consumers. Everything was working fine in VC++ debug build however it stopped working in the release build. When I debug into the release build, debugger was pointing at Ln 64 of activemqconnectionfactory.cpp with code:

this->username = username;

where username was shown to have a "Bad Ptr".

In my code, I am creating a ConnectionFactory using:

auto_ptr<ConnectionFactory> connectionFactory(
                                ConnectionFactory::createCMSConnectionFactory( brokerURI ) );


I am also using the thread library in decaf.

Does anyone know what might be wrong and what I can do to fix the issues? Any suggestions are appreciated.

Re: Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

by Timothy Bish :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-10-22 at 09:11 -0700, andrewdc wrote:

> I am newbie on acticemq CMS API. I have compiled ActiveMQ CMS v3.0.1 source
> in Visual C++ 2005 Express. I am following the CMS examples developing queue
> producers and consumers. Everything was working fine in VC++ debug build
> however it stopped working in the release build. When I debug into the
> release build, debugger was pointing at Ln 64 of
> activemqconnectionfactory.cpp with code:
>
> this->username = username;
>
> where username was shown to have a "Bad Ptr".
>
> In my code, I am creating a ConnectionFactory using:
>
> auto_ptr<ConnectionFactory> connectionFactory(
> ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
>
>
> I am also using the thread library in decaf.
>
> Does anyone know what might be wrong and what I can do to fix the issues?
> Any suggestions are appreciated.

Can you supply a small but complete test case that demonstrates the
problem?

Regards
Tim.


--
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

by andrewdc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Tim.

I have just tried running vs2005-activemq-example in a release build (I was able to run that example in debug build with success), and I am getting "Bad Ptr" right away, the debugger was pointing at Ln 53 of xmemory, the code at that line:

::new (_Vptr) _T1(_Val);

My code was built on top of vs2005-activemq-example, do you think there might be an issue in vs2005-activemq-example?


andrewdc wrote:
I am newbie on acticemq CMS API. I have compiled ActiveMQ CMS v3.0.1 source in Visual C++ 2005 Express. I am following the CMS examples developing queue producers and consumers. Everything was working fine in VC++ debug build however it stopped working in the release build. When I debug into the release build, debugger was pointing at Ln 64 of activemqconnectionfactory.cpp with code:

this->username = username;

where username was shown to have a "Bad Ptr".

In my code, I am creating a ConnectionFactory using:

auto_ptr<ConnectionFactory> connectionFactory(
                                ConnectionFactory::createCMSConnectionFactory( brokerURI ) );


I am also using the thread library in decaf.

Does anyone know what might be wrong and what I can do to fix the issues? Any suggestions are appreciated.

Re: Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

by Timothy Bish :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-10-22 at 14:04 -0700, andrewdc wrote:

> Hi, Tim.
>
> I have just tried running vs2005-activemq-example in a release build (I was
> able to run that example in debug build with success), and I am getting "Bad
> Ptr" right away, the debugger was pointing at Ln 53 of xmemory, the code at
> that line:
>
> ::new (_Vptr) _T1(_Val);
>
> My code was built on top of vs2005-activemq-example, do you think there
> might be an issue in vs2005-activemq-example?
>

I've run both the Static lib and Dynamic Lib versions of the example in
release mode without issue.  Not sure what is happening in your case,
need to provide more info I'm afraid.

Regards
Tim.



>
>
> andrewdc wrote:
> >
> > I am newbie on acticemq CMS API. I have compiled ActiveMQ CMS v3.0.1
> > source in Visual C++ 2005 Express. I am following the CMS examples
> > developing queue producers and consumers. Everything was working fine in
> > VC++ debug build however it stopped working in the release build. When I
> > debug into the release build, debugger was pointing at Ln 64 of
> > activemqconnectionfactory.cpp with code:
> >
> > this->username = username;
> >
> > where username was shown to have a "Bad Ptr".
> >
> > In my code, I am creating a ConnectionFactory using:
> >
> > auto_ptr<ConnectionFactory> connectionFactory(
> > ConnectionFactory::createCMSConnectionFactory( brokerURI ) );
> >
> >
> > I am also using the thread library in decaf.
> >
> > Does anyone know what might be wrong and what I can do to fix the issues?
> > Any suggestions are appreciated.
> >
>
--
Tim Bish
http://fusesource.com
http://timbish.blogspot.com/




Re: Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

by andrewdc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tim,

Can you explain the difference between a static and dynamic build. I have a feeling I might be doing something incorrect during linking stage. what I had is having activemq cms as static lib and libapr-1.dll and libaprutil-1.dll. do you thinking this might cause issues I am seeing?

Thanks again for the help.

-- Andrew

andrewdc wrote:
I am newbie on acticemq CMS API. I have compiled ActiveMQ CMS v3.0.1 source in Visual C++ 2005 Express. I am following the CMS examples developing queue producers and consumers. Everything was working fine in VC++ debug build however it stopped working in the release build. When I debug into the release build, debugger was pointing at Ln 64 of activemqconnectionfactory.cpp with code:

this->username = username;

where username was shown to have a "Bad Ptr".

In my code, I am creating a ConnectionFactory using:

auto_ptr<ConnectionFactory> connectionFactory(
                                ConnectionFactory::createCMSConnectionFactory( brokerURI ) );


I am also using the thread library in decaf.

Does anyone know what might be wrong and what I can do to fix the issues? Any suggestions are appreciated.

Re: Help: Error Creating CMS Connection in VC++ 2005 Release Build Only

by andrewdc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I figured it out. I was using debug versions of activemq cms lib when building release versions of my project. After I built with release versions of dependent libs, the problem went away. thanks for the help.

Regards,
Andrew


andrewdc wrote:
I am newbie on acticemq CMS API. I have compiled ActiveMQ CMS v3.0.1 source in Visual C++ 2005 Express. I am following the CMS examples developing queue producers and consumers. Everything was working fine in VC++ debug build however it stopped working in the release build. When I debug into the release build, debugger was pointing at Ln 64 of activemqconnectionfactory.cpp with code:

this->username = username;

where username was shown to have a "Bad Ptr".

In my code, I am creating a ConnectionFactory using:

auto_ptr<ConnectionFactory> connectionFactory(
                                ConnectionFactory::createCMSConnectionFactory( brokerURI ) );


I am also using the thread library in decaf.

Does anyone know what might be wrong and what I can do to fix the issues? Any suggestions are appreciated.