Some additional information that I've obtained from the debugging process. This malloc error is occurring in:
void RepeatedField<Element>::Reserve(int new_size) this is in repeated_field.h. On Tuesday, January 10, 2017 at 10:51:12 AM UTC-6, Doug Lewis wrote: > > Here's the error message I get during execution: > > lStat: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= > (unsigned long) (nb)' failed. > > This code is executing on a Beaglebone ARM board running Linux RTOS. > We're cross compiling. > > We have tried this same code building it on Windows and we do not get the > malloc error on Windows so we believe it is something to do with the memory > setup on the embedded board. > > Regards, > Doug > > > On Friday, January 6, 2017 at 6:37:04 PM UTC-6, Adam Cozzette wrote: >> >> Could you provide some more details on what the error message looks like? >> I don't see anything obviously wrong with your code, so it's hard to say >> what the problem could be. >> >> On Fri, Jan 6, 2017 at 9:01 AM, Doug Lewis <[email protected]> wrote: >> >>> I get a malloc error when I try to add a repeated message element. >>> >>> Below is the .proto message definition: >>> >>> message Discovery >>> { >>> uint32 lmuSerialNumber = 1; >>> uint64 gpsTime = 2; >>> repeated EquipmentInfo discoveredUnits = 3; >>> } >>> >>> Here is the code where I'm trying to add discoveredUnits to the message: >>> >>> for (int i = 0; i < numOfAssocMotes; i++) >>> { >>> EquipmentInfo* assocUnitInfo = >>> outAssocUnitDiscoveryMsg.add_associatedunits(); >>> assocUnitInfo->set_unitserialnumber(mySerialNum); >>> assocUnitInfo->set_latitude(myLatitude); >>> assocUnitInfo->set_longitude(myLongitude); >>> } >>> >>> I get the malloc error when the add_associatedunits() function is called. >>> >>> Thanks, >>> Doug >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Protocol Buffers" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/protobuf. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
