certi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [certi-dev] Crash with some STL vector


From: Michael Raab
Subject: Re: [certi-dev] Crash with some STL vector
Date: Wed, 10 Nov 2010 08:52:06 +0100

Hi Eric,

your blind fix did not change anything. :-(

The good news is, I think I found the error,
I changed the following in RTItypesImp.cc, line 187 ff

AttributeHandleSetImp::AttributeHandleSetImp(const std::vector<certi::AttributeHandle> &val)
{
        _set.reserve(val.size());
        std::copy(val.begin(), val.end(), _set.begin());
}

to

AttributeHandleSetImp::AttributeHandleSetImp(const std::vector<certi::AttributeHandle> &val)
{
        _set.resize(val.size());
        for(int i=0; i < val.size(); ++i)
                _set[i] = val[i];
}


I would guess that std::copy operates not well with std::vector::reserve as afaik rerserve doesn't resize the vector.
The I think you were writing over some border.
Would you check this into the repository?

Thanks,
Michael



Dipl.-Inf. Michael Raab

Fraunhofer-Institut für Fabrikbetrieb und -automatisierung IFF
Virtuell Interaktives Training
Sandtorstr. 22, 39106 Magdeburg, Germany                
Telefon +49 (0) 391/ 40 90 122
Telefax +49 (0) 391/ 40 90 115
address@hidden
http://www.iff.fraunhofer.de oder http://www.vdtc.de



Von:        Eric Noulard <address@hidden>
An:        CERTI development discussions <address@hidden>
Datum:        11/09/2010 11:49 PM
Betreff:        Re: [certi-dev] Crash with some STL vector
Gesendet von:        address@hidden




2010/11/9 Michael Raab <address@hidden>:
> It is the first PAVU request.

I have tried a "blind fix"
I've just checked in CVS, please update an retry
even if I'm pretty sure this is not the end of the story

There is two Federate->RTI services which may generate RTI-->Federate PAVU

RTI::RTIambassador::requestClassAttributeValueUpdate
or
RTI::RTIambassador::requestObjectAttributeValueUpdate

Do you call either of this API or both?
If only one, which one?
If both could you tell me which one is called first (and seems to
generate the first PAVU)?

Since PAVU is a federate ambassador callback could you give me the content
of the callback you use?
i.e. your overloaded version of:

virtual void provideAttributeValueUpdate(RTI::ObjectHandle, const
RTI::AttributeHandleSet &)
                throw (RTI::ObjectNotKnown, RTI::AttributeNotKnown,
RTI::AttributeNotOwned, RTI::FederateInternalError) { }

Is the signature exactly the same as this one (including possibly
thrown Exception)?


If your problem is still there after my blind fix, could you try to add:

PAVU->show(std::cerr);

just before the offending line in RTIambPrivateRefs..cc

should be between line 837 and 838.

837: M_Provide_Attribute_Value_Update* PAVU =
static_cast<M_Provide_Attribute_Value_Update *>(msg);
838:                  std::auto_ptr<RTI::AttributeHandleSet> attributeSet(
839:                                                                    new AttributeHandleSetImp(PAVU->getAttributes()));

--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org

--
CERTI-Devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/certi-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]