Bug 2721 - Signal 10 (bus error) in smbd
Summary: Signal 10 (bus error) in smbd
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.14a
Hardware: PA-RISC HP-UX
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
Depends on:
Reported: 2005-05-17 06:17 UTC by Richard Allen
Modified: 2005-08-24 10:19 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Richard Allen 2005-05-17 06:17:21 UTC
I have three HP9000 machines in a ServiceGuard cluster (NFS+Cifs cluster).  All
three machines are running HP-UX 11i (v1.6 (11.11)) and are reasonably well patched.

I'm attempting to upgrade samba in some packages to 3.0.14a.

It compiles nicly on HP-UX. Only one switch was used in the ./configure phase
and that was --prefix

Samba starts and runs untill a connection attempt is made.  Log shows:

[2005/05/13 09:45:51, 0] lib/fault.c:fault_report(37)
  INTERNAL ERROR: Signal 10 in pid 27867 (3.0.14a)
  Please read the appendix Bugs of the Samba HOWTO collection
[2005/05/13 09:45:51, 0] lib/fault.c:fault_report(39)
Comment 1 Richard Allen 2005-05-17 08:27:03 UTC
I recompiled Samba with DUMP_CORE 1 but the dump core code seems to be broken.
I Then added 'panic action = "/bin/sleep 9999"' in [global] and attach to the
process with gdb.

[2005/05/17 15:03:33, 0] lib/fault.c:fault_report(37)
  INTERNAL ERROR: Signal 10 in pid 1725 (3.0.14a)
  Please read the appendix Bugs of the Samba HOWTO collection
[2005/05/17 15:03:33, 0] lib/fault.c:fault_report(39)
[2005/05/17 15:03:33, 0] lib/util.c:smb_panic2(1485)
  smb_panic(): calling panic action [/bin/sleep 9999]

(gdb) where
#0  0xc020da80 in _waitpid_sys+0x10 () from /usr/lib/libc.2
#1  0xc0219ac4 in waitpid+0x6c () from /usr/lib/libc.2
#2  0xc02041a8 in _system_sys+0x1b8 () from /usr/lib/libc.2
#3  0xc0219538 in system+0x60 () from /usr/lib/libc.2
#4  0x1c2cb0 in smb_panic2+0xc8 () from /sgparasol/opt/samba/sbin/smbd
#5  0x1c2bc8 in smb_panic+0x10 () from /sgparasol/opt/samba/sbin/smbd
#6  0x1a9a74 in fault_report+0x54 () from /sgparasol/opt/samba/sbin/smbd
#7  0x1a9d14 in sig_fault+0x10 () from /sgparasol/opt/samba/sbin/smbd
#8  <signal handler called>
#9  0x1acb54 in sys_stat+0x30 () from /sgparasol/opt/samba/sbin/smbd
#10 0x9e2bc in vfswrap_stat+0x14 () from /sgparasol/opt/samba/sbin/smbd
#11 0xadbb0 in make_connection_snum+0x504 () from /sgparasol/opt/samba/sbin/smbd
#12 0xaf11c in make_connection+0x284 () from /sgparasol/opt/samba/sbin/smbd
#13 0x6f9fc in reply_tcon_and_X+0x3d0 () from /sgparasol/opt/samba/sbin/smbd
#14 0xab424 in switch_message+0x37c () from /sgparasol/opt/samba/sbin/smbd
#15 0xab7b4 in construct_reply+0x88 () from /sgparasol/opt/samba/sbin/smbd
#16 0xabc0c in process_smb+0x270 () from /sgparasol/opt/samba/sbin/smbd
#17 0xacb1c in smbd_process+0x100 () from /sgparasol/opt/samba/sbin/smbd
#18 0x228bc4 in main+0x6ec () from /sgparasol/opt/samba/sbin/smbd

Hope this helps some.
Comment 2 Ermin Borovac 2005-06-28 23:54:46 UTC
I have exactly same problem on HP-UX 11i v1 (11.11) with Samba 3.0.14a compiled
with HP's ANSI C compiler (by default it generates 32-bit objects).

I think this problem is related to use of stat64() for handling of large files.

smbd get signal 10 after the following line in sys_stat() (lib/system.c).

        /* we always want directories to appear zero size */
        if (ret == 0 && S_ISDIR(sbuf->st_mode)) sbuf->st_size = 0;

If stat64() is used then sbuf should be pointer to 'struct stat64'. Instead
*sbuf is defined as 'struct stat' in make_connection_snum() (smbd/service.c)
which calls sys_stat().

In declaration for sys_stat() SMB_STRUCT_STAT is used instead of 'struct stat'.

int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf)

SMB_STRUCT_STAT is defined to either 'struct stat64' or 'struct stat' depending
on large file support (in include/includes.h).

There are many other references to 'struct stat' in samba source code. Should
they all be replaced with SMB_STRUCT_STAT?

Going back to the problem, it's simply fixed by changing 'struct stat st' in
make_connection_snum to 'SMB_STRUCT_STAT st' and recompiling.

Alternatively one can recompile with -D_FILE_OFFSET_BITS=64 in which case source
code doesn't need to be changed.

Comment 3 Jeremy Allison 2005-06-29 09:40:44 UTC
Very good debugging ! Well done. This is fixed in the current SVN code.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:19:09 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.