Azure / iot-edge-v1

Azure IoT Edge
http://azure.github.io/iot-edge/
Other
524 stars 258 forks source link

Memory leak caused by connection break #409

Open villepalo opened 6 years ago

villepalo commented 6 years ago

Using version 2017-09-14 on linux.

Memory leak can be reproduced with simulated_device_cloud_upload_sample -sample.

  1. Start the sample application
  2. Disconnect network
  3. Wait for error messages
  4. Reconnect

Memory usage increases and valgrind reports memory leaks. Memory leaks are not reported without network disconnection.

Valgrind log attached valgrind_disconnected.log

For testing I used little bit modified configuration json, attached here simulated_device_cloud_upload_lin.txt

villepalo commented 6 years ago

Happens only with AMQP, with MQTT memory is not leaked.

villepalo commented 6 years ago

BTW this is not the same issue as #413, valgrid output is different and symptoms are different. Build environment was ubuntu 14.04

villepalo commented 6 years ago

I tried to reproduce this using only iot-sdk-c but without success. Tested with iot-sdk-c 2018-01-29 and 2018-04-02. Application used for testing was iothub_ll_telemetry_sample

villepalo commented 6 years ago

I guess this is fixed in: https://github.com/Azure/azure-iot-sdk-c/commit/c6bbf5e0ee4ae6745a014e90b3eed0cf2658cacb

villepalo commented 6 years ago

Yes, I cherry-picked that c6bbf5e commit and memory is not leaking anymore.

So, this will be fixed when submodules are updated.