Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Suggestion of a test for mosquitto

Hi Sergey,
About the memory leak, is it crashing your app?
If yes, if you compile in debug you could inspect the core dump ?

 you can also implement your own functions free/malloc. 
In addition to malloc and free, you can then store the pointers, their location in the code, the size allocated into a big table to trace the missing free.

I can share code for this if you want.


On Wed, 24 Jun 2020, 19:35 Sergey Grekhov, <grekhss@xxxxxxxxx> wrote:

Hello, dear developers of mosquitto!

Recently I have made a series of tests with _modified_ version mosquitto (modified by me) and experienced a memory leak.

The problem with detecting this leak is that I use a very specific environment with does not allow using valgrind, sanitizer, whatever else.

So, I would like to describe the use case which I have made and ask if mosquitto was tested like that or not.

The configuration is following:

  1. there is a broker #1 which runs on device
  2. there is a broker #2 which runs on some cloud service
  3. broker #1 creates a secure bridge (mbedTLS connection) with broker #2
  4. there are some clients of broker #1 which send data to each other and over the bridge into the cloud

The situation which leads to memory leak:

  1. broker #2 decides for some reasons (I do now know why) to disconnect the created bridge
  2. broker #1 detects that it has been disconnected and tries to reconnect
  3. broker #1 reconnects and continue to send the data
  4. steps 1-3 repeats 5-10 times
  5. broker #1 experience memory leak

I have tested several times (tests we actually quite long - about 3-5 days) on several devices. And memory leak situation (some applications crashed with OOM error) was very stable on device which was disconnected. Instead, another device (identical hardware and software) ran stably during our tests and it was not disconnected from the cloud.

Of course, the memory leak could be introduced by my changes of mosquitto. Unfortunately, I have no possibility to investigate this issue due to H/W restrictions. Probably, running such test for stable mosquitto under Linux could clarify this situation.

I will be happy to answer any of your questions.

Kind regards,

Sergey.

_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top