From owner-svn-src-head@FreeBSD.ORG Wed Jun 10 15:24:08 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3874943; Wed, 10 Jun 2015 15:24:08 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv158.fwdcdn.com (frv158.fwdcdn.com [212.42.77.158]) (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 A17601536; Wed, 10 Jun 2015 15:24:08 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=XYNSdmv6/wFmYH65i5N2UUtKbM01KI8BLVXQbxYLB8c=; b=clo2q242cArymAf/hPgnLWvm4M16tvK1xH3ILLn0pjDTKiA4BsgfZzPOEJM2fK3qdb7nspbmJBLFZuaL3Yv2flkrqWYqUMaLBZ/Gw4RJgfR/ZNoZR9Ihhdz8Prmj8hpyB16gxMETMrIJA07ChjU25bab+Bhz8lN2Sb9frL7LYV8=; Received: from [134.249.91.180] (helo=nonamehost.local) by frv158.fwdcdn.com with esmtpsa ID 1Z2hrH-00035b-0F ; Wed, 10 Jun 2015 18:24:03 +0300 Date: Wed, 10 Jun 2015 18:24:01 +0300 From: Ivan Klymenko To: Mateusz Guzik Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik Subject: Re: svn commit: r284215 - in head/sys: amd64/linux32 compat/linux compat/svr4 dev/drm2/i915 fs/fdescfs i386/ibcs2 i386/linux kern ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mthca sys vm Message-ID: <20150610182401.685fb7b6@nonamehost.local> In-Reply-To: <20150610135337.GC23380@dft-labs.eu> References: <201506101048.t5AAmD1O029382@svn.freebsd.org> <20150610163326.20ab3e0c@nonamehost.local> <20150610135337.GC23380@dft-labs.eu> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=134.249.91.180; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2015 15:24:09 -0000 Wed, 10 Jun 2015 15:53:37 +0200 Mateusz Guzik =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =B2: > On Wed, Jun 10, 2015 at 04:33:26PM +0300, Ivan Klymenko wrote: > > Wed, 10 Jun 2015 10:48:13 +0000 (UTC) > > Mateusz Guzik =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0= =B2: > >=20 > > > Author: mjg > > > Date: Wed Jun 10 10:48:12 2015 > > > New Revision: 284215 > > > URL: https://svnweb.freebsd.org/changeset/base/284215 > > >=20 > > > Log: > > > Implement lockless resource limits. > > > =20 > > > Use the same scheme implemented to manage credentials. > > > =20 > > > Code needing to look at process's credentials (as opposed to > > > thred's) is provided with *_proc variants of relevant functions. > > > =20 > > > Places which possibly had to take the proc lock anyway still use > > > the proc pointer to access limits. > > >=20 > > >=20 > >=20 > > I have panic. > > I not sure that it refers to a specific commit. > >=20 > > Fatal trap 12: page fault while in kernel mode > > cpuid =3D 0; apic id =3D 00 > > fault virtual address =3D 0x80 > > fault code =3D supervisor read data, page not present > > instruction pointer =3D 0x20:0xffffffff809cfbfa > > stack pointer =3D 0x28:0xfffffe01aa4906c0 > > frame pointer =3D 0x28:0xfffffe01aa4906e0 > > code segment =3D base 0x0, limit 0xfffff, type 0x1b > > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > > current process =3D 4091 (npviewer.bin) > > trap number =3D 12 > > panic: page fault > > cpuid =3D 0 > > KDB: stack backtrace: > > #0 0xffffffff80a17c27 at kdb_backtrace+0x67 > > #1 0xffffffff809d3f79 at vpanic+0x189 > > #2 0xffffffff809d3de3 at panic+0x43 > > #3 0xffffffff80e73b35 at trap_fatal+0x355 > > #4 0xffffffff80e73e6e at trap_pfault+0x31e > > #5 0xffffffff80e734d4 at trap+0x464 > > #6 0xffffffff80e57422 at calltrap+0x8 > > #7 0xffffffff8097c942 at fdalloc+0x32 > > #8 0xffffffff8097cf95 at finstall+0x95 > > #9 0xffffffff80a99844 at kern_openat+0x3c4 > > #10 0xffffffff8229fe93 at linux_common_open+0xc3 > > #11 0xffffffff822a0068 at linux_open+0x58 > > #12 0xffffffff80f7408b at ia32_syscall+0x41b > > #13 0xffffffff80e57a05 at Xint0x80_syscall+0x95 > > Uptime: 29m1s > > Dumping 854 out of 6047 > > MB:..2%..12%..21%..32%..42%..51%..62%..72%..81%..92% > >=20 > > 221 pcpu.h: No such file or directory. > > in pcpu.h > > (kgdb) #0 doadump (textdump=3D) at pcpu.h:221 > > #1 0xffffffff809d3a7d in kern_reboot (howto=3D260) > > at /usr/src/sys/kern/kern_shutdown.c:447 > > #2 0xffffffff809d3fb8 in vpanic (fmt=3D,=20 > > ap=3D) > > at /usr/src/sys/kern/kern_shutdown.c:744 #3 0xffffffff809d3de3 in > > panic (fmt=3D0x0) at /usr/src/sys/kern/kern_shutdown.c:675 > > #4 0xffffffff80e73b35 in trap_fatal (frame=3D,=20 > > eva=3D) > > at /usr/src/sys/amd64/amd64/trap.c:853 #5 0xffffffff80e73e6e in > > trap_pfault (frame=3D0xfffffe01aa490610, usermode=3D > out>) at /usr/src/sys/amd64/amd64/trap.c:676 #6 0xffffffff80e734d4 > > out>in trap (frame=3D0xfffffe01aa490610) > > at /usr/src/sys/amd64/amd64/trap.c:426 > > #7 0xffffffff80e57422 in calltrap () > > at /usr/src/sys/amd64/amd64/exception.S:235 > > #8 0xffffffff809cfbfa in lim_cur (td=3D0xfffff8010185e4c0, which=3D8) > > at /usr/src/sys/kern/kern_resource.c:1209 > > #9 0xffffffff8097c942 in fdalloc (td=3D0xfffff8010185e4c0,=20 > > minfd=3D, result=3D0xfffffe01aa4907dc) > > at /usr/src/sys/kern/kern_descrip.c:790 > > #10 0xffffffff8097cf95 in finstall (td=3D0xfffff8010185e4c0,=20 > > fp=3D0xfffff80139e89870, fd=3D0xfffffe01aa4907dc, flags=3D1, > > fcaps=3D0x0) at /usr/src/sys/kern/kern_descrip.c:1768 > > #11 0xffffffff80a99844 in kern_openat (td=3D0xfffff8010185e4c0, > > fd=3D-100, path=3D0xfffff80016832400 "/compat/linux/proc/stat", > > pathseg=3DUIO_SYSSPACE, flags=3D, mode=3D > optimized out>) at /usr/src/sys/kern/vfs_syscalls.c:1158 > > #12 0xffffffff8229fe93 in linux_common_open (td=3D0xfffff8010185e4c0, > > dirfd=3D8, path=3D0xfffff80016832400 "/compat/linux/proc/stat",=20 > > l_flags=3D, mode=3D51) > > at /usr/src/sys/modules/linux/../../compat/linux/linux_file.c:134 > > #13 0xffffffff822a0068 in linux_open (td=3D,=20 > > args=3D) > > at /usr/src/sys/modules/linux/../../compat/linux/linux_file.c:211 > > #14 0xffffffff80f7408b in ia32_syscall (frame=3D0xfffffe01aa490ac0) > > at subr_syscall.c:133 > > #15 0xffffffff80e57a05 in Xint0x80_syscall () at ia32_exception.S:73 > > #16 0x00000000ffffe452 in ?? () > > Previous frame inner to this frame (corrupt stack?) > > Current language: auto; currently minimal > > (kgdb)=20 > >=20 >=20 > The following should fix it: > diff --git a/sys/compat/linux/linux_fork.c > b/sys/compat/linux/linux_fork.c index 0fd47fd..394c26f 100644 > --- a/sys/compat/linux/linux_fork.c > +++ b/sys/compat/linux/linux_fork.c > @@ -298,7 +298,7 @@ linux_clone_thread(struct thread *td, struct > linux_clone_args *args) __rangeof(struct thread, td_startcopy, > td_endcopy));=20 > newtd->td_proc =3D p; > - newtd->td_ucred =3D crhold(td->td_ucred); > + thread_cow_get(newtd, td); > =20 > /* create the emuldata */ > linux_proc_init(td, newtd, args->flags); >=20 > Still, it seems a bug that linux_clone_thread replicates so much of > create_thread. >=20 Seems it helps to solve this problem. Panic more not reproduced. Thank you.