[3938] in arla-drinkers

home help back first fref pref prev next nref lref last post

Process pointer PID panics

daemon@ATHENA.MIT.EDU (christopher@0x90.org)
Sat Jun 10 02:41:35 2006

From arla-drinkers-bounces@stacken.kth.se Sat Jun 10 06:41:35 2006
Return-Path: <arla-drinkers-bounces@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 29234 invoked from network); 10 Jun 2006 06:41:34 -0000
Received: from mx3.kth.se (130.237.48.97)
  by charon.mit.edu with SMTP; 10 Jun 2006 06:41:34 -0000
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mx3.kth.se (Postfix) with ESMTP id 8C70314071A;
	Sat, 10 Jun 2006 08:41:33 +0200 (CEST)
Received: from mx3.kth.se ([127.0.0.1])
 by localhost (mx3.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP
 id 19744-02-74; Sat, 10 Jun 2006 08:41:32 +0200 (CEST)
Received: from tapas.stacken.kth.se (tapas.stacken.kth.se [130.237.234.140])
	by mx3.kth.se (Postfix) with ESMTP id 05D011405C3;
	Sat, 10 Jun 2006 08:41:32 +0200 (CEST)
Received: from tapas.stacken.kth.se (localhost [127.0.0.1])
	by tapas.stacken.kth.se (Postfix) with ESMTP id C2B85534FC;
	Sat, 10 Jun 2006 08:41:31 +0200 (CEST)
X-Original-To: arla-drinkers@tapas.stacken.kth.se
Delivered-To: arla-drinkers@tapas.stacken.kth.se
Received: from brev.stacken.kth.se (brev.stacken.kth.se [130.237.234.84])
	by tapas.stacken.kth.se (Postfix) with ESMTP id AB96B534FC
	for <arla-drinkers@tapas.stacken.kth.se>;
	Sat, 10 Jun 2006 08:41:30 +0200 (CEST)
Received: from mx1.kth.se (mx1.kth.se [130.237.32.140])
	by brev.stacken.kth.se (8.12.10/8.12.10) with ESMTP id k5A6fTRv001476
	for <arla-drinkers@stacken.kth.se>;
	Sat, 10 Jun 2006 08:41:30 +0200 (MET DST)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mx1.kth.se (Postfix) with ESMTP id 5C72B1452C1
	for <arla-drinkers@stacken.kth.se>;
	Sat, 10 Jun 2006 08:41:28 +0200 (CEST)
Received: from mx1.kth.se ([127.0.0.1])
	by localhost (mx1.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP
	id 31917-02-17 for <arla-drinkers@stacken.kth.se>;
	Sat, 10 Jun 2006 08:41:27 +0200 (CEST)
Received: from nop.0x90.org (unknown [66.241.137.149])
	by mx1.kth.se (Postfix) with ESMTP id 4B5281452D7
	for <arla-drinkers@stacken.kth.se>;
	Sat, 10 Jun 2006 08:41:27 +0200 (CEST)
Received: by nop.0x90.org (Postfix, from userid 1008)
	id 29D7542074A; Sat, 10 Jun 2006 02:08:52 -0400 (EDT)
Date: Sat, 10 Jun 2006 02:08:52 -0400
From: christopher@0x90.org
To: arla-drinkers@stacken.kth.se
Subject: Process pointer PID panics
Message-ID: <20060610060852.GA19245@0x90.org>
Mime-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.11
X-Virus-Scanned: by amavisd-new at kth.se
X-Spam-Status: No, hits=-2.3 tagged_above=-200.0 required=5.0 tests=BAYES_00, 
	NO_REAL_NAME
X-Spam-Level: 
X-BeenThere: arla-drinkers@stacken.kth.se
X-Mailman-Version: 2.1.6
Precedence: list
List-Id: Arla discussions <arla-drinkers.stacken.kth.se>
List-Unsubscribe: <https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers>, 
	<mailto:arla-drinkers-request@stacken.kth.se?subject=unsubscribe>
List-Archive: <http://lists.stacken.kth.se/pipermail/arla-drinkers>
List-Post: <mailto:arla-drinkers@stacken.kth.se>
List-Help: <mailto:arla-drinkers-request@stacken.kth.se?subject=help>
List-Subscribe: <https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers>, 
	<mailto:arla-drinkers-request@stacken.kth.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: arla-drinkers-bounces@stacken.kth.se
Errors-To: arla-drinkers-bounces@stacken.kth.se
X-Virus-Scanned: by amavisd-new at kth.se

It seems a simple patch for such a harrowing journey through kernel
internals trying to pinpoint this.

If a client application (ie: not arlad) opens the /dev/nnpfs0 device
before daemon-ifying itself, the (chan->proc) pointer will point into
the process struct from the starting shell.

This leads to terrifying lockmgr panics where the culprit appears to be
commands run from the shell such as 'tail' since the first process
struct seen by nnpfs is cached and passed all over the place.  Another
such artifact is the 'deadlock avoided' message from nnpfs_message_rpc.

This will not affect arlad, since it does daemon() before open(), but
other applications using the nnpfs interface may be affected.

Hope this helps
--chris

(Patch is against the 0.42 source)
--- nnpfs/bsd/nnpfs_dev-common.c.orig	Sat Jun 10 01:38:23 2006
+++ nnpfs/bsd/nnpfs_dev-common.c	Sat Jun 10 01:39:34 2006
@@ -281,8 +281,11 @@
 		     (unsigned long)chan->messageq.prev,
 		     (unsigned long)chan->messageq.next));
 
-
-    if (chan->proc == NULL)
+    /*
+     * The process ID of the client may change after open.  Since only one open
+     * is permitted, this must be our client.
+     */
+    if (chan->proc == NULL || chan->proc != nnpfs_get_proc(uiop))
 	chan->proc = nnpfs_get_proc(uiop);
 
  again:
_______________________________________________
Arla-drinkers mailing list
Arla-drinkers@stacken.kth.se
https://lists.stacken.kth.se/mailman/listinfo/arla-drinkers

home help back first fref pref prev next nref lref last post