On Tuesday, 22 August 2017 06:26:48 PDT Iosif Hamlatzis wrote:
> After hours and hours of searching with no result I decided to take the
> source code of the simpleserver example and build it myself instead of
> trying the pre-build sample and as a result it throws the same exception at
> the same line of code.
>
> Checking the source of IoTivity I think the reason for the exception has to
> do with the fact that it cannot create payload
>
> https://github.com/iotivity/iotivity/blob/master/resource/src/OCRepresentati
> on.cpp
>
> from the class OCRepresentation the method OCRepPayload*
> OCRepresentation::getPayload() const is called end OCRepPayloadCreate();
> returns NULL;
>
>
> I don't know why on my host machine and on a raspberry there is no problem.
That function does:
OCRepPayload* OCRepPayloadCreate()
{
OCRepPayload* payload = (OCRepPayload*)OICCalloc(1, sizeof(OCRepPayload));
if (!payload)
{
return NULL;
}
payload->base.type = PAYLOAD_TYPE_REPRESENTATION;
return payload;
}
And OICCalloc does:
return calloc(num, size);
So that means your system libc returned NULL from calloc.
This is not an IoTivity problem. Your device is out of memory.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev