Bug 4483 - out of file desriptors and segv in libsmbcilent.so
Summary: out of file desriptors and segv in libsmbcilent.so
Status: RESOLVED INVALID
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.0.24
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-02 22:51 UTC by Ron Dilley
Modified: 2007-08-13 13:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Dilley 2007-04-02 22:51:28 UTC
While running a share crawler against a large number of servers, I keep running out of file descriptors and getting a segv while talking to MS print servers.  I am able to run the same code against large qty of netapp storage and misc. windows servers w/o this symptom.  It is probably my code, but I have looked over it several times and can't seem to see how I am inducing the segv.  I have increased the fd limit to cope with the leaking file descriptors but the segv continues to annoy.  <grin>

Here is a snip of my code (smbcd.c 899)

... snip ...
  /****
   *
   * open directory
   *
   ****/

  if ( ( dirFileDescriptor = smbc_opendir( path ) ) < 0 ) {
    if ( config->debug >= 3 )
      display( LOG_ERR, "Could not open [%s] (%d:%s)\n", path, errno, strerror( errno ) );

    XFREE( urlBuf );
    XFREE( readBuf );
    return 1;
  }
... snip ...

I have gone through the code six ways from Sunday to make sure the path variable is sane.  I have reproduce the segv by scanning the print server.  It segv at the same share (aka printer).

Please let me know if there is any other info I can provide (like sniffer traces, etc).

#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7c9c7d0 in raise () from /lib/libc.so.6
#2  0xb7c9dea3 in abort () from /lib/libc.so.6
#3  0x0804b638 in sigsegvHandler (signo=11) at smbcd.c:472
#4  <signal handler called>
#5  0xb7dfac4b in read_socket_with_timeout () from /opt/samba/current/lib/libsmbclient.so.0
#6  0xb7dfae6e in read_smb_length_return_keepalive () from /opt/samba/current/lib/libsmbclient.so.0
#7  0xb7dfaf9e in receive_smb_raw () from /opt/samba/current/lib/libsmbclient.so.0
#8  0xb7e14adb in cli_receive_smb () from /opt/samba/current/lib/libsmbclient.so.0
#9  0xb7e16025 in cli_negprot () from /opt/samba/current/lib/libsmbclient.so.0
#10 0xb7dc6d93 in smbc_server () from /opt/samba/current/lib/libsmbclient.so.0
#11 0xb7dce68a in smbc_opendir_ctx () from /opt/samba/current/lib/libsmbclient.so.0
#12 0xb7dd1158 in smbc_opendir () from /opt/samba/current/lib/libsmbclient.so.0
#13 0x0804a057 in processDirectory (path=0xbfc51174 "smb://xxx.xxx.xxx.xxx/HPLJ8000-48", parent=0x929dda8)
    at smbcd.c:899
#14 0x0804afb2 in crawlShares (targetList=0x8056548) at smbcd.c:785
#15 0x0804bfe5 in main (argc=8, argv=0xbfc53274) at smbcd.c:376
Comment 1 Volker Lendecke 2007-04-03 06:17:01 UTC
Can you run your code under valgrind? Beware, this slows it down by a factor of 10 at least.

Volker
Comment 2 Derrell Lipman 2007-08-13 13:11:10 UTC
No reply in four months.  Closing.  Please re-open if problem persists and you've determined via valgrind that the problem is in libsmbclient.

Derrell