Home My Page Projects Code Snippets Project Openings DPWS Core
Summary Activity Forums Tracker Tasks Docs Surveys News SCM Files Mediawiki

[#419] potential memory leak in discovery

Date:
2015-08-17 14:38
Priority:
3
State:
Open
Submitted by:
Antoine Hincelin (ahincelin)
Assigned to:
Stéphane ROUGES (srouges)
Target Fix Version:
none
Product:
DPWS Core
Operating System:
All
Component:
none
Version:
v2.5.1
Severity:
normal
Resolution:
Fixed
Hardware:
none
URL:
Summary:
potential memory leak in discovery

Detailed description
Under some circumstances, handles attached to discovery memory are not all released,
which creates a memory leak when calling deleteHandlePool()

cf DPWS.log below
handles of type 32 (BYE msg) are created 2 times, but there are deleted only once.

It seems that reactor didn't have time to execute last item: send_bye_callback. (delayed item?), which should release the handle.

In deleteHandlePool(), maybe DC_FREE should be applied to handle pool as well, not only to recycling pool?
Message  ↓
Date: 2015-08-31 15:58
Sender: Antoine Hincelin

Thanks for the fix Stéphane.
Best regards,
Antoine

Date: 2015-08-31 12:36
Sender: Stéphane ROUGES

Hi Antoine,
I posted a fix. I did detect a memory leak in the handle pool when stopping a sample. The fix seems to fix it. Hope you will be able to check it in your use-case.
Best regards,
Stéphane

Date: 2015-08-31 12:27
Sender: Antoine Hincelin

Hi Stéphane,

Here is the shutdown sequence:

dpws_stop_server(200);
dpws_server_shutdown(NULL);
dpws_shutdown();

Regards,
Antoine

Date: 2015-08-31 10:23
Sender: Stéphane ROUGES

Hi Antoine,
What you say makes sense. To be sure, I guess you are stopping the stack with a sequence dpws_stop_server_XXX() (with a timeout or maybe none) + dpws_shutdown() ?
Regards,
Stéphane

Attachments:
Size Name Date By Download
31 KiBDPWS.log2015-08-17 14:38ahincelinDPWS.log
Field Old Value Date By
ResolutionNone2015-08-31 12:36srouges
assigned_tonone2015-08-31 10:23srouges
File Added69: DPWS.log2015-08-17 14:38ahincelin