Re: [Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-25 Thread Kiran VM
On Thu, 24 Mar 2005 11:01:02 -0800, Jeremy Allison [EMAIL PROTECTED] wrote:
 On Thu, Mar 24, 2005 at 11:11:44PM +0530, Kiran VM wrote:
  Hello Jerry,
 
  No CloseHandle() call is made in both the case. CFile (or for that
  reason CStdioFile) Close() method will close the OS file handle.
  (closehandle() in the sample code is commented given can be ignored)
 
  Just to make it a bit more clearer, the executable (for testing i just
  put the sample code above inside a for loop of 1000) is run from a
  win2k3 server and xp machine. XP shows no handle increase leak (handle
  count of 85), but in Win2k3 the handle count was around 1085 ( for
  1000 iterations). This information i got from the windows task
  manager. Upon this, i tried the procexp tool from sysinternals. This
  clearly showed that the Handle being leaked is a file handle,
  \\TestServer\TestShare in our case. (This is not the file as such but
  the directory).
 
  BTW, my samba server is on Solaris 9.
 
  Please let me know if you erquire any further information...
 
 Can you send me the binary (.exe) of this program. Also, the
 information on how to report any handle leaks on the Windows
 side. Given that info I can try to track this one on my own.
 
 Thanks,
 
Jeremy.
 
Hello Jeremy, Hello Jerry,

I have attached a test exe (tester.exe) which will reproduce the
problem. ( rename the tester.exe1 to tester.exe inside the zip file tester.zip1)

Just run tester with the remote file name (from the samba share) as
the parameter. (eg. Tester.exe \\TestServer\TestShare\tempfile.txt).
The program will open the given file 1000 times in a loop. The source
code for this is also attached if you want to make any change. If you
run this on a Win2K3 server, the handle count increases to 1000 and
on an XP client it is around 10.

You can see the handle count in the taskmanager itself. In the process
tab of task manager, select the option view-select columns. here
check the Handle count check box. Now just monitor the tester.exe
process (when it is runnning) in the task manager, you can see the
count there.

Task manager does not show what kind of handles are open. For this we
use a free ware from systinternals (called procexp). This can be
downloaded from
http://www.sysinternals.com/ntw2k/freeware/procexp.shtml.(i can send
it if you want.)  Just run this tool and select
tester.exe when it is running. This will show all the open handles on
the bottom pane. On Win2K3 server, we can see that there are many file
handles are open to the directory in our samba share.

If you still could not reproduce this problem, please let me know.
Also, if you require more info from me, please let me know.

Thanks and best regards,
Kiran

PS: Just a brief desc about by samba config.

Im running a 64 bit Samba 3.0.10( tried 3.0.13 also)  on Solaris 9
with the smb conf something like this.



[global]
   workgroup = NMUSOL
   netbios name = TestServer
   interfaces = 132.186.71.238
   bind interfaces only = Yes
   security = DOMAIN
   password server = 132.186.70.122
   log level = 2
   ldap ssl = no
   kernel oplocks = no

[TestShare]
   path = /export/home1/TestShare
   read only = No
   oplocks = no
   strict locking = yes
   level2 oplocks = no
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

Re: [Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-25 Thread Kiran VM
 
 Hello Jeremy, Hello Jerry,
 
 I have attached a test exe (tester.exe) which will reproduce the
 problem. ( rename the tester.exe1 to tester.exe inside the zip file 
 tester.zip1)
 
 Just run tester with the remote file name (from the samba share) as
 the parameter. (eg. Tester.exe \\TestServer\TestShare\tempfile.txt).
 The program will open the given file 1000 times in a loop. The source
 code for this is also attached if you want to make any change. If you
 run this on a Win2K3 server, the handle count increases to 1000 and
 on an XP client it is around 10.
 
 You can see the handle count in the taskmanager itself. In the process
 tab of task manager, select the option view-select columns. here
 check the Handle count check box. Now just monitor the tester.exe
 process (when it is runnning) in the task manager, you can see the
 count there.
 
 Task manager does not show what kind of handles are open. For this we
 use a free ware from systinternals (called procexp). This can be
 downloaded from
 http://www.sysinternals.com/ntw2k/freeware/procexp.shtml.(i can send
 it if you want.)  Just run this tool and select
 tester.exe when it is running. This will show all the open handles on
 the bottom pane. On Win2K3 server, we can see that there are many file
 handles are open to the directory in our samba share.
 
 If you still could not reproduce this problem, please let me know.
 Also, if you require more info from me, please let me know.
 
 Thanks and best regards,
 Kiran
 
 PS: Just a brief desc about by samba config.
 
 Im running a 64 bit Samba 3.0.10( tried 3.0.13 also)  on Solaris 9
 with the smb conf something like this.
 
 [global]
   workgroup = NMUSOL
   netbios name = TestServer
   interfaces = 132.186.71.238
   bind interfaces only = Yes
   security = DOMAIN
   password server = 132.186.70.122
   log level = 2
   ldap ssl = no
   kernel oplocks = no
 
 [TestShare]
   path = /export/home1/TestShare
   read only = No
   oplocks = no
   strict locking = yes
   level2 oplocks = no
 
 
 

Hello Jerry, Jeremy,

Sorry, iam not able to send attachement to the list so let me put the
code in the mail itself.

Im Msdev, start a new project,  select win32 console application. give
the project name as Tester. Then in the tester.cpp put the following
code compile and execute as mentioned in my earlier mail.

Please let me know if you require any other info.

Thanks,
Kiran


___n_
// Tester.cpp : Defines the entry point for the console application.
//

#include stdafx.h
#include Tester.h

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr  _T(Fatal Error: MFC initialization failed)  endl;
return 1;
}

if( argc != 2)
{
cout _T(Usage: Tester.exe complete UNC path of the shared 
file)endl;
cout _T(Example: Tester.exe
TestServer\\TestShare\\tempfile.txt)endl;
return 1;
}

CString strFileName = argv[1];
int nCount = 1000;

cout  _T(Opening file )(LPCTSTR)strFileName_T(
)nCount_T( times)endl;

for (int i = 0; i  nCount ; i++)
{

CFile fValueFile;
if( !fValueFile.Open(strFileName,CFile::modeReadWrite  ) )
{
cout_T(Open failed with error)GetLastError()endl;
}
else
{
coutOpened for iteration iendl;
}


fValueFile.Close();



}

cout_T(Iteration completed. Press enter to exit)endl;

getchar();

return 0;
}
// Tester.cpp : Defines the entry point for the console application.
//

#include stdafx.h
#include Tester.h

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;

// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr  _T(Fatal Error: MFC initialization 

[Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-24 Thread Kiran VM
Hello Jerry,

No CloseHandle() call is made in both the case. CFile (or for that
reason CStdioFile) Close() method will close the OS file handle.
(closehandle() in the sample code is commented given can be ignored)

Just to make it a bit more clearer, the executable (for testing i just
put the sample code above inside a for loop of 1000) is run from a
win2k3 server and xp machine. XP shows no handle increase leak (handle
count of 85), but in Win2k3 the handle count was around 1085 ( for
1000 iterations). This information i got from the windows task
manager. Upon this, i tried the procexp tool from sysinternals. This
clearly showed that the Handle being leaked is a file handle,
\\TestServer\TestShare in our case. (This is not the file as such but
the directory).

BTW, my samba server is on Solaris 9.

Please let me know if you erquire any further information...

Thanx,
Kiran


On Thu, 24 Mar 2005 09:52:20 -0600, Gerald (Jerry) Carter
[EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Kiran VM wrote:
 
 ||   CString strSearchPath =
 _T(TestServer\\TestShare\\tempfile.txt);
 ||   CStdioFile fValueFile;
 ||   if( !fValueFile.Open(strSearchPath,CFile::modeReadWrite  ) )
 ...
 ||   //CloseHandle( (HANDLE)fValueFile.m_hFile );
 ||   fValueFile.Close();
 |
 | Hello Jerry,
 |
 | I just now compiled and installed 3.0.13. But the result is the same.
 | Any idea why this is happening?
 
 Nope.  Just to make sure I understand the issue.  With a Samba
 file share you have to explicitly include the call to CloseHandle()
 where as on a 2k3 file server, the Close() method handles it all
 right?  How do you know you're leaking handles here ?  e.g. what
 tool are you using ?
 
 We'll probably need to look at raw network traces between the same test
 program run against 2k3 and Samba file servers.
 
 
 
 cheers, jerry
 =
 Alleviating the pain of Windows(tm)  --- http://www.samba.org
 GnuPG Key- http://www.plainjoe.org/gpg_public.asc
 I never saved anything for the swim back. Ethan Hawk in Gattaca
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.2.5 (GNU/Linux)
 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
 iD8DBQFCQuI0IR7qMdg1EfYRAgz7AJwNdN4IQdVE3cPHYLz+cXMqxDtnEgCfeisM
 UPpJwi+pVmxW/VMfLj0zapk=
 =edpH
 -END PGP SIGNATURE-

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Re: Different behaviour of samba share in XP and Windows 2003 Server

2005-03-24 Thread Jeremy Allison
On Thu, Mar 24, 2005 at 11:11:44PM +0530, Kiran VM wrote:
 Hello Jerry,
 
 No CloseHandle() call is made in both the case. CFile (or for that
 reason CStdioFile) Close() method will close the OS file handle.
 (closehandle() in the sample code is commented given can be ignored)
 
 Just to make it a bit more clearer, the executable (for testing i just
 put the sample code above inside a for loop of 1000) is run from a
 win2k3 server and xp machine. XP shows no handle increase leak (handle
 count of 85), but in Win2k3 the handle count was around 1085 ( for
 1000 iterations). This information i got from the windows task
 manager. Upon this, i tried the procexp tool from sysinternals. This
 clearly showed that the Handle being leaked is a file handle,
 \\TestServer\TestShare in our case. (This is not the file as such but
 the directory).
 
 BTW, my samba server is on Solaris 9.
 
 Please let me know if you erquire any further information...

Can you send me the binary (.exe) of this program. Also, the
information on how to report any handle leaks on the Windows
side. Given that info I can try to track this one on my own.

Thanks,

Jeremy.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba