From owner-freebsd-questions@freebsd.org Sat Nov 18 09:27:14 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 6B848DF2D25 for ; Sat, 18 Nov 2017 09:27:14 +0000 (UTC) (envelope-from jau789@gmail.com) 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 4486A69508 for ; Sat, 18 Nov 2017 09:27:14 +0000 (UTC) (envelope-from jau789@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 404FCDF2D24; Sat, 18 Nov 2017 09:27:14 +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 3FAFFDF2D23 for ; Sat, 18 Nov 2017 09:27:14 +0000 (UTC) (envelope-from jau789@gmail.com) Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com [IPv6:2a00:1450:4010:c07::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 502DD69507 for ; Sat, 18 Nov 2017 09:27:13 +0000 (UTC) (envelope-from jau789@gmail.com) Received: by mail-lf0-x22c.google.com with SMTP id e143so5149227lfg.12 for ; Sat, 18 Nov 2017 01:27:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:user-agent:mime-version :content-language; bh=u63TJEi6RbqxHZ9zAhpqPJ/s8QbtoX4UtbVNzhhHIXc=; b=SWlOVda81wwSgIV+H7WtKk3uAomZYOU4NWhDFqzbQTt7/5dfKIZ1tdyn5H6UAGFm4B veY16ERMLdYGZcMTrKPd8/ASm4UlCeE8s2nT1M0jVmE5NbB1yy2EeBHYHlTZa8pY9KJu NgcNazv0KXkUVOcin3EDrWdLv6BkwnjqIwrwnGs5OGZWvXjajh0Ewv1Z6U22Dtt+EpQu PozAlODfL6E1L7nyr4/O/k8H8AeRfpAF6d9zA8tkZZYOTYBpOfrrKkvraC1u7eCIARsU 9g8gYli64tl36xmpgVVAoRw+e84nRieZ+cxtBacdlyYGARTzEsnFNsPFD4z5z5xkaukq Nogg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language; bh=u63TJEi6RbqxHZ9zAhpqPJ/s8QbtoX4UtbVNzhhHIXc=; b=E/9D9tiiWzsY1nRDcq+9M5b5F47709+JtcIRQ7YRODMsDT/ty7wE4bKHad4Zl2h/hN S7WvSwqslP/biUFRmXC8QvmKIxMmVK9xUUjkDzlUgpNsZEGgod0av7mKY21Dua8suoqw LbK39D3y2Mk1H244JQfoyaUZnWkU6cHJEom0wTxsEtVMo8Am5jEVT0ZqldcD2X7jTZOI sFqP190ZOOZUeg4pXYdw1zK5fxoRu55bQ9HVBxcz+ckBAuvgzz56BhpyVgAFZlqMD8CY KXQUVX+l65JnRyNR+nU1g27x+suTDGgkTwYvAmJvijXGmYdrJqdDU3nquGB/5tHq47Mu YBPA== X-Gm-Message-State: AJaThX6KEy81Wlb7Uxz2xgoSL9m9dadO4EwUR17U+nv+vDNxnPQGuGg3 n5UlNaTN5jazgAlAJMvr6Ecg0w== X-Google-Smtp-Source: AGs4zMZlt07Jpa1DDjrP/CF4KlTfXnCCjye/yfwJWGNJ1ygf9cNHMQhtQmtubg215xpjEcw+rc4D7A== X-Received: by 10.46.65.66 with SMTP id o63mr1926069lja.172.1510997231120; Sat, 18 Nov 2017 01:27:11 -0800 (PST) Received: from [192.168.1.131] (xdsl-205-1.nblnetworks.fi. [83.145.205.1]) by smtp.googlemail.com with ESMTPSA id z68sm674346lje.26.2017.11.18.01.27.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Nov 2017 01:27:10 -0800 (PST) From: "Jukka A. Ukkonen" Subject: 10.4-stable systematically crashing inside pselect() when a tun device is used To: questions@freebsd.org Message-ID: Date: Sat, 18 Nov 2017 11:27:07 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-GB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 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: Sat, 18 Nov 2017 09:27:14 -0000 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 always panics the kernel with the complaints shown in the photo below. When using a tap device the same code works just fine. After a little eyeballing I failed to notice any obvious reason for this in the tun device code. I hope someone who knows the tun device better might be able to tell me what should I see in this. At the very minimum the pselect() call should fail properly with an error code. Raising a panic and crashing the whole kernel gives me the impression that there is something very seriously wrong there. At least for now it just has not dawned to me what it is. The system doing this is just the average amd64 running 10-stable. So, this should not be a hardware related issue on a rarely used hardware. Any hints, pointers, helpful sophisticated guesses etc. would be welcome. —jau