From owner-freebsd-stable@freebsd.org Thu Sep 15 20:44:20 2016 Return-Path: Delivered-To: freebsd-stable@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 9A2C7BDCADF for ; Thu, 15 Sep 2016 20:44:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (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 5D0BAF97; Thu, 15 Sep 2016 20:44:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bkdW4-000KOI-JG; Thu, 15 Sep 2016 23:44:16 +0300 Date: Thu, 15 Sep 2016 23:44:16 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: freebsd-stable@freebsd.org Subject: Re: nginx and FreeBSD11 Message-ID: <20160915204416.GZ2840@zxy.spb.ru> References: <20160907191348.GD22212@zxy.spb.ru> <1823460.vTm8IvUQsF@ralph.baldwin.cx> <20160915174948.GW2840@zxy.spb.ru> <15357564.UUkYdbUZHc@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15357564.UUkYdbUZHc@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2016 20:44:20 -0000 On Thu, Sep 15, 2016 at 11:54:12AM -0700, John Baldwin wrote: > On Thursday, September 15, 2016 08:49:48 PM Slawa Olhovchenkov wrote: > > On Thu, Sep 15, 2016 at 10:28:11AM -0700, John Baldwin wrote: > > > > > On Thursday, September 15, 2016 05:41:03 PM Slawa Olhovchenkov wrote: > > > > On Wed, Sep 07, 2016 at 10:13:48PM +0300, Slawa Olhovchenkov wrote: > > > > > > > > > I am have strange issuse with nginx on FreeBSD11. > > > > > I am have FreeBSD11 instaled over STABLE-10. > > > > > nginx build for FreeBSD10 and run w/o recompile work fine. > > > > > nginx build for FreeBSD11 crushed inside rbtree lookups: next node > > > > > totaly craped. > > > > > > > > > > I am see next potential cause: > > > > > > > > > > 1) clang 3.8 code generation issuse > > > > > 2) system library issuse > > > > > > > > > > may be i am miss something? > > > > > > > > > > How to find real cause? > > > > > > > > I find real cause and this like show-stopper for RELEASE. > > > > I am use nginx with AIO and AIO from one nginx process corrupt memory > > > > from other nginx process. Yes, this is cross-process memory > > > > corruption. > > > > > > > > Last case, core dumped proccess with pid 1060 at 15:45:14. > > > > Corruped memory at 0x860697000. > > > > I am know about good memory at 0x86067f800. > > > > Dumping (form core) this region to file and analyze by hexdump I am > > > > found start of corrupt region -- offset 0000c8c0 from 0x86067f800. > > > > 0x86067f800+0xc8c0 = 0x86068c0c0 > > > > > > > > I am preliminary enabled debuggin of AIO started operation to nginx > > > > error log (memory address, file name, offset and size of transfer). > > > > > > > > grep -i 86068c0c0 error.log near 15:45:14 give target file. > > > > grep ce949665cbcd.hls error.log near 15:45:14 give next result: > > > > > > > > 2016/09/15 15:45:13 [notice] 1055#0: *11659936 AIO_RD 000000082065DB60 start 000000086068C0C0 561b0 2646736 ce949665cbcd.hls > > > > 2016/09/15 15:45:14 [notice] 1060#0: *10998125 AIO_RD 000000081F1FFB60 start 000000086FF2C0C0 6cdf0 140016832 ce949665cbcd.hls > > > > 2016/09/15 15:45:14 [notice] 1055#0: *11659936 AIO_RD 00000008216B6B60 start 000000086472B7C0 7ff70 2999424 ce949665cbcd.hls > > > > > > Does nginx only use AIO for regular files or does it also use it with sockets? > > > > Only for regular files. > > > > > You can try using this patch as a diagnostic (you will need to > > > run with INVARIANTS enabled, > > > > How much debugs produced? > > I am have about 5-10K aio's per second. > > > > > or at least enabled for vfs_aio.c): > > > > How I can do this (enable INVARIANTS for vfs_aio.c)? > > Include INVARIANT_SUPPORT in your kernel and add a line with: > > #define INVARIANTS > > at the top of sys/kern/vfs_aio.c. # sysctl -a | grep -i inva kern.timecounter.invariant_tsc: 1 kern.features.invariant_support: 1 options INVARIANT_SUPPORT but no string `vmspace mismatch` in kernel. May be I am miss some? #define INVARIANTS #include __FBSDID("$FreeBSD: stable/11/sys/kern/vfs_aio.c 304738 2016-08-24 09:18:38Z kib $"); #include "opt_compat.h" #include #include #include #include #include