From owner-freebsd-questions@freebsd.org Sun Nov 19 11:11:34 2017 Return-Path: Delivered-To: freebsd-questions@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 43E44DF206D for ; Sun, 19 Nov 2017 11:11:34 +0000 (UTC) (envelope-from srs0=dfra=cr=sigsegv.be=kristof@codepro.be) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9E27404E for ; Sun, 19 Nov 2017 11:11:34 +0000 (UTC) (envelope-from srs0=dfra=cr=sigsegv.be=kristof@codepro.be) Received: by mailman.ysv.freebsd.org (Postfix) id 26E77DF206B; Sun, 19 Nov 2017 11:11:34 +0000 (UTC) Delivered-To: questions@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 2696EDF206A for ; Sun, 19 Nov 2017 11:11:34 +0000 (UTC) (envelope-from srs0=dfra=cr=sigsegv.be=kristof@codepro.be) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E22977404A for ; Sun, 19 Nov 2017 11:11:33 +0000 (UTC) (envelope-from srs0=dfra=cr=sigsegv.be=kristof@codepro.be) Received: from [10.0.2.164] (ptr-8ripyyf0hkyecsj1e8w.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:2419:4e02:2877:c3f0:8a70:2160]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id D166BAB04; Sun, 19 Nov 2017 12:11:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sigsegv.be; s=mail; t=1511089889; bh=747+YlEITgK+RpNIWLzqWXe20IfvflTqUgkMurgk0+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=x70+yMuZjKVc0TNfbublIkBE6Z5tjes0DDyQENnnEwe4YgpFzFHG+t93y6HVI2R66 HbClj49Qw43jGypbM6wJmrca3SFsz97dDmmLJs5lCL6IQlW/xfkqejmQWeYGn6gUC6 fIGnw/PWaCATVYoHrLbeDwXHJWz9kjhwaX41Chw8= From: "Kristof Provost" To: "Jukka A. Ukkonen" Cc: questions@freebsd.org Subject: Re: 10.4-stable systematically crashing inside pselect() when a tun device is used Date: Sun, 19 Nov 2017 12:11:28 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Mailer: MailMate (2.0BETAr6096) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 11:11:34 -0000 On 18 Nov 2017, at 17:16, Jukka A. Ukkonen wrote: > Hello all, > > As briefly stated in the subject I have a 10-stable system on > which I have been testing a program which opens either a tun > device or a tap device, waits in pselect() for the descriptor > to become readable, and then proceeds to read the packet/frame. > When using a tun descriptor the pselect() call systematically > panics the kernel with the complaints shown in the text dump > snippet at the end of this message. When using a tap device > the same code works just fine. Can you post the code that you use to trigger this too? > Fatal trap 12: page fault while in kernel mode > cpuid = 10; apic id = 13 > fault virtual address = 0x8 Clearly a NULL pointer dereference (into a struct). > trap number = 12 > panic: page fault > cpuid = 10 > KDB: stack backtrace: > #0 0xffffffff80a97b60 at kdb_backtrace+0x60 > #1 0xffffffff80a57d26 at vpanic+0x126 > #2 0xffffffff80a57bf3 at panic+0x43 > #3 0xffffffff80e8b84d at trap_fatal+0x35d > #4 0xffffffff80e8bb68 at trap_pfault+0x308 > #5 0xffffffff80e8b1ca at trap+0x47a > #6 0xffffffff80e6f93c at calltrap+0x8 > #7 0xffffffff80aaa645 at taskqueue_run_locked+0xf5 So this happens on a task queue, but we don’t know which one from the backtrace. It’s not immediately obvious where this would be happening, so it’d be quite useful if you could post the user space code (and setup) that triggers this. Regards, Kristof