EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Serious Memory leak of your samples

Also by EldoS: SecureBlackbox
200+ components and classes for digital security, signing, encryption and secure networking.
#10392
Posted: 06/16/2009 00:10:35
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

The sanples you give out have serious memory leak.
For examples you run fileMon.exe ,from "task manager" you will see that
memory useage of your FileMon increase everytime you open a new File,
and never decrease.
#10393
Posted: 06/16/2009 02:06:42
by Eugene Mayevski (EldoS Corp.)

The samples are not intended to be full-featured polished applications. They just illustrate the use of the component.


Sincerely yours
Eugene Mayevski
#10405
Posted: 06/16/2009 19:08:36
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

Your sample:Filemon is so simple that I do not find any code which may cause
memory leak.So I am afraid that Your cbflt.lib even your filter driver cbflt.sys have memory leak.
#10407
Posted: 06/17/2009 01:00:17
by Eugene Mayevski (EldoS Corp.)

Drivers work in context of System process, so it can't be the driver. Most likely it's the string values which are not freed by the application (some APIs return strings which must be freed by the application in C++ API). We will check this.

Also, Task Manager must NOT be used to detect memory leaks. It just lies. You need to use specialized memory leak detection tools for this.


Sincerely yours
Eugene Mayevski
#10410
Posted: 06/17/2009 05:51:12
by Vladimir Cherniga (EldoS Corp.)

Please specify the version of FileMon sample(C++, Dephi, .NET).
#10411
Posted: 06/17/2009 06:07:56
by Eugene Mayevski (EldoS Corp.)

It's C++ (as .lib file is mentioned).


Sincerely yours
Eugene Mayevski
#10417
Posted: 06/17/2009 09:57:03
by Alexander Plas (EldoS Corp.)

Please change AddToLog function according to this
Code
void AddToLog(LPCTSTR Value)
{
  long lCount = SendMessage(g_hLog, LB_GETCOUNT, 0, 0);
  while (lCount >= 1000)
  {
    SendMessage(g_hLog, LB_DELETESTRING, 0, 0);
    lCount--;
  }
  SendMessage(g_hLog, LB_ADDSTRING, 0, (LPARAM)Value);
  SendMessage(g_hLog, LB_SETCURSEL, lCount, 0);
}

and recheck memory consumption.
#10418
Posted: 06/17/2009 18:58:40
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

1)Is c++ version.
2)I would say,AddToLog will not cause memory leak.because I have disable AddToLog
void CbFltOpenFileN(
CallbackFilter* Sender,
LPWSTR FileName,
ACCESS_MASK DesiredAccess,
WORD FileAttributes,
WORD ShareMode,
DWORD CreateOptions)
{
WCHAR text[MAX_PATH * 2];
wsprintfW(text, L"OpenFileN %s", FileName);
//AddToLog(text);
}

Most likely It is in your .lib
#10426
Posted: 06/18/2009 13:25:35
by Vladimir Cherniga (EldoS Corp.)

Make tests with attached driver.


[ Download ]
#10428
Posted: 06/18/2009 18:58:37
by Wang Sheng (Basic support level)
Joined: 02/16/2009
Posts: 44

Remain the same.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 13488 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!