qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Hartline <andrewhartl...@gmail.com>
Subject Re: qpid-cpp: bad_allocs when using "empty" Message constructor within Boost test framework
Date Tue, 08 Sep 2015 23:49:25 GMT
Got it --- there were some subtle linker problems that weren't errors, but
led to some of the dreaded undefined behaviour. Now that VS2013 knows
exactly where my .lib files are and which ones to use, all's well.


On Tue, Sep 8, 2015 at 2:48 PM, Andrew Hartline <andrewhartline@gmail.com>

> Hi qpid users,
> I have an interesting issue. In the qpid-cpp examples the following idiom
> works to create a Message object on the stack.
>         Message m;
> This looks like it should be calling an empty constructor but in fact no
> such constructor is defined. Instead it's calling this one:
>         Message
> <https://qpid.apache.org/releases/qpid-0.28/messaging-api/cpp/api/classqpid_1_1messaging_1_1Message.html#a10ceff23ff6fde62d9026fd13bc28662>
> std::string &bytes=std::string())
> Creating a Message in this way works fine for me in the qpid-cpp examples,
> but it throws a std::bad_alloc when I do it from within the Boost test
> framework. I hypothesize that it has something to do with the construction
> of the defaulted string, but don't know what the details could be.
> If from inside the Boost framework,  I create a Message like so:
>         qpid::types::Variant v(123);
>         qpid::messaging::Message msg(v);
> there is no bad_alloc.
> Throwing in this dummy Variant is ok as a workaround, but I would love to
> know what's going on under the hood. Does anyone have any idea why I might
> be getting these bad_allocs?
> Thanks,
> Andrew

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message