From owner-freebsd-bugs@freebsd.org Sat Nov 4 05:21:29 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16BBE6543E for ; Sat, 4 Nov 2017 05:21:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6881288 for ; Sat, 4 Nov 2017 05:21:29 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id vA45LT1a032608 for ; Sat, 4 Nov 2017 05:21:29 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 223413] writev() fails repeatedly with EAGAIN after sendfile() fails with EAGAIN Date: Sat, 04 Nov 2017 05:21:29 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: youzhong@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Nov 2017 05:21:29 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D223413 Bug ID: 223413 Summary: writev() fails repeatedly with EAGAIN after sendfile() fails with EAGAIN Product: Base System Version: 11.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: youzhong@gmail.com Recently I started evaluating FreeBSD, including the Samba software. Unfortunately once I set 'use sendfile =3D yes' in Samba, and then tried to launch an application from the samba share, it hung. The application is not= a small one, it loads thousands of files from the server to Windows client. It appears the sendfile() failed with EAGAIN: # dtrace -n 'syscall::sendfile:return /arg1 =3D=3D -1/ {ustack(); printf("e= rrno =3D %d", errno);}' dtrace: description 'syscall::sendfile:return ' matched 1 probe CPU ID FUNCTION:NAME 23 64274 sendfile:return libc.so.7`__sys_sendfile+0xa libsmbd-base-samba4.so`vfswrap_sendfile+0x127 libsmbd-base-samba4.so`smb_vfs_call_sendfile+0x6d libsmbd-base-samba4.so`smb2_sendfile_send_data+0x8e libtalloc.so.2.1.9`_tc_free_internal+0x152 libtalloc.so.2.1.9`_tc_free_children_internal+0xac libtalloc.so.2.1.9`_tc_free_internal+0x331 libtalloc.so.2.1.9`_talloc_free_internal+0xb2 libtalloc.so.2.1.9`_talloc_free+0x114 libsmbd-base-samba4.so`smbd_smb2_flush_send_queue+0x37a libsmbd-base-samba4.so`smbd_smb2_request_reply+0x1886 libsmbd-base-samba4.so`smbd_smb2_request_done_ex+0x62b libsmbd-base-samba4.so`smbd_smb2_request_read_done+0x32f libtevent.so.0.9.31`_tevent_req_notify_callback+0x6c libsmbd-base-samba4.so`smbd_smb2_request_pending_queue+0x3f libsmbd-base-samba4.so`smbd_smb2_request_process_read+0x4ef libsmbd-base-samba4.so`smbd_smb2_request_dispatch+0x1f03 libsmbd-base-samba4.so`smbd_smb2_io_handler+0x8e2 libsmbd-base-samba4.so`smbd_smb2_connection_handler+0x46 libtevent.so.0.9.31`poll_event_loop_poll+0x75c errno =3D 35 then Samba process 'smbd' tried to send data using writev(), but writev() failed repeatedly with EAGAIN: # dtrace -n 'syscall::writev:return /arg1 =3D=3D -1/ {ustack(); printf("err= no =3D %d", errno);}' 16 63748 writev:return libc.so.7`_writev+0xa libsys-rw-samba4.so`sys_writev+0x21 libsys-rw-samba4.so`write_data_iov+0x88 libsys-rw-samba4.so`write_data+0x39 libsmbd-base-samba4.so`fake_sendfile+0x16e libsmbd-base-samba4.so`smb2_sendfile_send_data+0x61a libtalloc.so.2.1.9`_tc_free_internal+0x152 libtalloc.so.2.1.9`_tc_free_children_internal+0xac libtalloc.so.2.1.9`_tc_free_internal+0x331 libtalloc.so.2.1.9`_talloc_free_internal+0xb2 libtalloc.so.2.1.9`_talloc_free+0x114 libsmbd-base-samba4.so`smbd_smb2_flush_send_queue+0x37a libsmbd-base-samba4.so`smbd_smb2_request_reply+0x1886 libsmbd-base-samba4.so`smbd_smb2_request_done_ex+0x62b libsmbd-base-samba4.so`smbd_smb2_request_read_done+0x32f libtevent.so.0.9.31`_tevent_req_notify_callback+0x6c libsmbd-base-samba4.so`smbd_smb2_request_pending_queue+0x3f libsmbd-base-samba4.so`smbd_smb2_request_process_read+0x4ef libsmbd-base-samba4.so`smbd_smb2_request_dispatch+0x1f03 libsmbd-base-samba4.so`smbd_smb2_io_handler+0x8e2 errno =3D 35 # dtrace -n 'syscall::sendfile:return { @["sendfile", execname, errno] =3D count();}' -n 'syscall::writev:return { @["writev", execname, errno] =3D count();}' writev syslogd 0 1 sendfile smbd 35 3 writev unbound 0 5 writev winbindd 0 33 writev smbd 0 1725 sendfile smbd 0 5388 writev smbd 35 276979542 The FreeBSD version is 11.1-RELEASE, and Samba is 4.6.8. I don't know how to reproduce it without using Samba. I can do dtrace. Please let me know what can be done next to find out the r= oot cause of the issue. By the way, I am not familiar with the FreeBSD src code. --=20 You are receiving this mail because: You are the assignee for the bug.=