qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chuck Rolke (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-5663) [C++ Messaging] Windows AMQP 1.0 map_receiver fails freeing uninitialized string Variant
Date Fri, 04 Apr 2014 18:28:20 GMT

    [ https://issues.apache.org/jira/browse/QPID-5663?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13960245#comment-13960245
] 

Chuck Rolke commented on QPID-5663:
-----------------------------------

This is not a regression. I dredged up a build from November 2013 and it has the same issue.

Receiving populated map messages, Amqp 1.0, on Windows has never worked in qpid messaging.

I tried a few things to characterize the failure.

1. Get map_sender to send less and less in the map. When the map is finally empty then the
error goes away and an empty "{}" is printed. With anything in the map then it fails.

2. The failure and the divergence between 0-10 and 1.0 shows up in MessageImpl::updated()
{code}
void MessageImpl::updated()
{
    ...
    if (!headers.size() && encoded) encoded->populate(headers);
    if (encoded && !contentDecoded) {
        encoded->getBody(bytes, content);    <======= amqp1.0 fails here
        contentDecoded = true;
    }
    encoded.reset();
}
{code}
Running amqp0-10 the call to encoded->getBody() is never executed.

3. The failing code path:
{code}
void DataBuilder::onString(const std::string& value, const std::string& encoding)
{
    switch (nested.top()->getType()) {
      case qpid::types::VAR_MAP:
        nested.push(&nested.top()->asMap()[value]);
        break;
      case qpid::types::VAR_LIST:
        nested.top()->asList().push_back(qpid::types::Variant(value));
        nested.top()->asList().back().setEncoding(encoding);
        break;
      default:
        qpid::types::Variant& v = *(nested.top());
        v = value;                                 <======= operator=() called
        v.setEncoding(encoding);
        nested.pop();
        break;
    }
}

Variant& Variant::operator=(const std::string& s)
{
    if (impl) delete impl;    <=======
    impl = new VariantImpl(s);
    return *this;
}
{code}
>From the stack trace
{noformat}
msvcr100d.dll!operator delete(void * pUserData=0xfeeefeee)
qpidtypesd.dll!std::allocator<char>::deallocate(char * _Ptr=0xfeeefeee, unsigned int
__formal=4277075695)
qpidtypesd.dll!std::basic_string<...>::_Tidy(bool _Built=true, unsigned int _Newsize=0)
qpidtypesd.dll!std::basic_string<...>::~basic_string<...>() 
qpidtypesd.dll!qpid::types::VariantImpl::~VariantImpl()  Line 174 + 0x12 bytes	C++
qpidtypesd.dll!qpid::types::VariantImpl::`scalar deleting destructor'()  + 0x16 bytes	C++
qpidtypesd.dll!qpid::types::Variant::operator=(const std::basic_string<.. > & s="colours")
 Line 761
{noformat}
There is a trip through *VariantImpl::`scalar deleting destructor'() *, a corner of C++ that
I don't know very well.

Ideas on how to proceed are welcome.

> [C++ Messaging] Windows AMQP 1.0 map_receiver fails freeing uninitialized string Variant
> ----------------------------------------------------------------------------------------
>
>                 Key: QPID-5663
>                 URL: https://issues.apache.org/jira/browse/QPID-5663
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Client
>    Affects Versions: 0.29
>         Environment: Windows x86 build on x64 host. Visual Studio 2010
>            Reporter: Chuck Rolke
>         Attachments: qpid-5663-stack-00.txt
>
>
> Running map_receiver with AMQP 1.0  fails straight away with a free of as string at 0xfeeefeee.
> {noformat}
> map_sender   localhost:5672 "message_queue; {create: always}" "{protocol:amqp1.0}"
> map_receiver localhost:5672 "message_queue; {create: always}" "{protocol:amqp1.0}"
> {noformat}
> These work indefinitely running amqp0-10. map_sender is fine running either protocol
version.
> Stack trace is posted as separate file.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message