asyncmqttclient corrupts memory on connect
dmelgar opened this issue · 0 comments
dmelgar commented
I have found very disturbing behavior. I've been able to narrow the issue down to the following. This is with ESP8266. Using version 0.9.0 of AsyncMqttClient.
Essentially the code is of the form,
main.cpp
Class1 a = Class1();
AsyncMqttClient b = AsyncMqttClient();
....
void onWifiConnect(...) {
b.connect();
}
The crazy behavior I'm observing is that the address of a
changes after MQTT connects.
It looks like AsyncMqttClient is corrupting the data segment.
I changed to allocate AsyncMqttClient off the heap instead and a
is no longer being corrupted, but I don't have confidence that its not just corrupting something else.
ie,
AsyncMqttClient *b = AsyncMqttClient()
Is this known behavior? Is there a preferred way to allocate/construct AsyncMqttClient?