NetBSD Problem Report #42241

From www@NetBSD.org  Wed Oct 28 10:58:29 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0270B63B902
	for <gnats-bugs@gnats.netbsd.org>; Wed, 28 Oct 2009 10:58:29 +0000 (UTC)
Message-Id: <20091028105828.ABF7563B8B6@www.NetBSD.org>
Date: Wed, 28 Oct 2009 10:58:28 +0000 (UTC)
From: stadtkind2@gmx.de
Reply-To: stadtkind2@gmx.de
To: gnats-bugs@NetBSD.org
Subject: Problems with AIO and Samba
X-Send-Pr-Version: www-1.0

>Number:         42241
>Category:       kern
>Synopsis:       Problems with AIO and Samba
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 28 11:00:01 +0000 2009
>Closed-Date:    
>Last-Modified:  Sun Oct 06 16:11:04 +0000 2019
>Originator:     Stefan Krüger
>Release:        NetBSD 5.0.1
>Organization:
>Environment:
NetBSD localhost 5.0.1 NetBSD 5.0.1 (GENERIC) #0: Thu Jul 30 01:39:11 UTC 2009  builds@b8.netbsd.org:/home/builds/ab/netbsd-5-0-1-RELEASE/i386/200907292356Z-obj/home/builds/ab/netbsd-5-0-1-RELEASE/src/sys/arch/i386/compile/GENERIC i386
>Description:
As already written in http://mail-index.netbsd.org/tech-kern/2009/10/27/msg006371.html , Samba compilied with AIO support and aio read/write enabled in smb.conf doesn't work correctly. The connection is dropped after some time (randomly with normal usage, pretty fast with Bart's Stuff Test 5, see "How to repeat").

A quick testrun produced a 46M ktrace.out file (120M "decoded" with kdump), which showed nothing suspicious IMHO

Running smbd with '-i' makes Samba quit during the test (I see a SIGTERM in ktrace), running it daemonized '-D' just spawns a new child it seems.

Mounting the share on FreeBSD (via mount_smbfs) and running fsx (File system exerciser, can be found in FreeBSDs src/tools/regression/fsx/ directory) on it works w/o any problems though...
>How-To-Repeat:
(Re)compile Samba with the following line

CONFIGURE_ARGS+=        --with-aio-support

added to pkgsrc/net/samba/Makefile

Edit smb.conf to include

aio read size = 4096
aio write size = 4096

Connect to the AIO enabled Samba share on Windows and run Bart's Stuff Test 5 ( http://www.nu2.nu/bst/ ) on it to trigger the problem easily
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->rmind
Responsible-Changed-By: rmind@NetBSD.org
Responsible-Changed-When: Wed, 28 Oct 2009 20:24:03 +0000
Responsible-Changed-Why:
Take.


From: Mindaugas Rasiukevicius <rmind@netbsd.org>
To: stadtkind2@gmx.de
Cc: gnats-bugs@NetBSD.org, netbsd-bugs@netbsd.org
Subject: Re: kern/42241 (Problems with AIO and Samba)
Date: Wed, 28 Oct 2009 20:30:22 +0000

 Hello,

 > As already written in 
 > http://mail-index.netbsd.org/tech-kern/2009/10/27/msg006371.html , Samba 
 > compilied with AIO support and aio read/write enabled in smb.conf doesn't work 
 > correctly. The connection is dropped after some time (randomly with normal 
 > usage, pretty fast with Bart's Stuff Test 5, see "How to repeat").
 > 
 > A quick testrun produced a 46M ktrace.out file (120M "decoded" with kdump), 
 > which showed nothing suspicious IMHO

 Can you show us the end of ktrace output?  Interest is in last aio syscall
 sequences and where it is stuck.

 > Running smbd with '-i' makes Samba quit during the test (I see a SIGTERM in 
 > ktrace), running it daemonized '-D' just spawns a new child it seems.

 ktrace(1) has option '-i' to trace children of process.

 Thanks.

 -- 
 Mindaugas

From: Stefan =?iso-8859-1?Q?Kr=FCger?= <stadtkind2@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: rmind@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/42241 (Problems with AIO and Samba)
Date: Wed, 28 Oct 2009 22:34:32 +0100

 On Wed, 28 Oct 2009, Mindaugas Rasiukevicius wrote:

 > >  Hello,
 > >
 > > As already written in
 > > http://mail-index.netbsd.org/tech-kern/2009/10/27/msg006371.html , Samba
 > > compilied with AIO support and aio read/write enabled in smb.conf doesn't
 > > work correctly. The connection is dropped after some time (randomly with
 > > normal usage, pretty fast with Bart's Stuff Test 5, see "How to repeat").
 > > 
 > > A quick testrun produced a 46M ktrace.out file (120M "decoded" with
 > > kdump), which showed nothing suspicious IMHO
 >  
 >  Can you show us the end of ktrace output?  Interest is in last aio syscall
 >  sequences and where it is stuck.

 end of ktrace output (captured using ktrace /usr/pkg/sbin/smbd -i) is:

   6590      1 smbd     CALL  munmap(0xbba65000,0x9d08)
   6590      1 smbd     RET   munmap 0
   6590      1 smbd     CALL  close(9)  
   6590      1 smbd     RET   close 0
   6590      1 smbd     CALL  munmap(0xbba41000,0xb000)
   6590      1 smbd     RET   munmap 0
   6590      1 smbd     CALL  close(0xa)
   6590      1 smbd     RET   close 0
   6590      1 smbd     CALL  kill(0, SIGTERM)
   6590      1 smbd     RET   kill 0
   6590      1 smbd     PSIG  SIGTERM caught handler=0x262714 mask=(8,13,31):
 code=SI_USER sent by pid=6590, uid=0)
   6590      1 smbd     CALL  write(0x14,0xbfbfe0d8,1)
   6590      1 smbd     GIO   fd 20 wrote 1 bytes  
        "\^O"
   6590      1 smbd     RET   write 1
   6590      1 smbd     CALL  setcontext(0xbfbfe194)
   6590      1 smbd     RET   syscall JUSTRETURN
   6590      1 smbd     CALL  exit(0)

 last aio syscall is:

   6590      1 smbd     CALL  aio_cancel(0x18,0xbb90b0e8)
   6590      1 smbd     RET   aio_cancel 3
   6590      1 smbd     CALL  fcntl(0xa,9,0xbfbfd634)
   6590      1 smbd     RET   fcntl 0
   6590      1 smbd     CALL  fcntl(0xa,9,0xbfbfd594)
   6590      1 smbd     RET   fcntl 0
   6590      1 smbd     CALL  close(0x18)
   6590      1 smbd     RET   close 0
   6590      1 smbd     CALL  geteuid
   6590      1 smbd     RET   geteuid 0
   6590      1 smbd     CALL  getegid
   6590      1 smbd     RET   getegid 0
   6590      1 smbd     CALL  setgroups(0,0)
   6590      1 smbd     RET   setgroups 0
   6590      1 smbd     CALL  setregid(0xffffffff,0)
   6590      1 smbd     RET   setregid 0
   6590      1 smbd     CALL  getegid
   6590      1 smbd     RET   getegid 0
   6590      1 smbd     CALL  setreuid(0xffffffff,0)
   6590      1 smbd     RET   setreuid 0
   6590      1 smbd     CALL  geteuid
   6590      1 smbd     RET   geteuid 0
   6590      1 smbd     CALL  write(1,0xbb90a280,0x3b)
   6590      1 smbd     GIO   fd 1 wrote 59 bytes
        "winxp (10.0.0.5) closed connection to service testuser\n"

 > > Running smbd with '-i' makes Samba quit during the test (I see a SIGTERM
 > > in ktrace), running it daemonized '-D' just spawns a new child it seems.
 >  
 >  ktrace(1) has option '-i' to trace children of process.

 when running ktrace -i /usr/pkg/sbin/smbd -D, the output looks a bit
 different

 last aio syscall is:

   9198      1 smbd     CALL  select(0x17,0xbfbfe504,0xbfbfe4e4,0,0xbfbfe52c)
   9198      1 smbd     RET   select -1 errno 4 Interrupted system call
   9198      1 smbd     PSIG  SIGRT2 caught handler=0xb1bec mask=(8,13,31):
 code=SI_ASYNCIO unimplemented)
   9198      1 smbd     CALL  write(0x13,0xbfbfdff8,1)
   9198      1 smbd     GIO   fd 19 wrote 1 bytes  
        "#"
   9198      1 smbd     RET   write 1
   9198      1 smbd     CALL  setcontext(0xbfbfe0b4)
   9198      1 smbd     RET   write JUSTRETURN
   9198      1 smbd     CALL  __sigprocmask14(1,0xbfbfe3e4,0)
   9198      1 smbd     RET   __sigprocmask14 0
   9198      1 smbd     CALL  aio_error(0xbb90b2c8)
   9198      1 smbd     RET   aio_error 0
   9198      1 smbd     CALL  aio_return(0xbb90b2c8)
   9198      1 smbd     RET   aio_return 65536/0x10000

 >  Thanks.

 np, let me know when you want more...

State-Changed-From-To: open->feedback
State-Changed-By: rmind@NetBSD.org
State-Changed-When: Sat, 30 Jan 2010 21:30:11 +0000
State-Changed-Why:
Can you please try with a latest netbsd-5 kernel?
There were few fixes in netbsd-5 branch.


From: Stefan =?iso-8859-1?Q?Kr=FCger?= <stadtkind2@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: rmind@NetBSD.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: kern/42241 (Problems with AIO and Samba)
Date: Sun, 31 Jan 2010 19:49:40 +0100

 On Sat, 30 Jan 2010, rmind@NetBSD.org wrote:

 > Synopsis: Problems with AIO and Samba
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: rmind@NetBSD.org
 > State-Changed-When: Sat, 30 Jan 2010 21:30:11 +0000
 > State-Changed-Why:
 > Can you please try with a latest netbsd-5 kernel?
 > There were few fixes in netbsd-5 branch.

 Just tried
 $ ident /netbsd | grep aio
       $NetBSD: sys_aio.c,v 1.19.8.3 2010/01/30 21:19:19 snj Exp $

 and it's still not working right, sorry

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 01 Feb 2010 03:40:32 +0000
State-Changed-Why:
still fails


Responsible-Changed-From-To: rmind->kern-bug-people
Responsible-Changed-By: rmind@NetBSD.org
Responsible-Changed-When: Sun, 06 Oct 2019 16:11:04 +0000
Responsible-Changed-Why:


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.