From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C23D23B585F for ; Wed, 27 May 2026 20:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779914671; cv=none; b=HJSkCwb4QQUc4NTVSSD6TAmr1gFos12v7JLhC2mRC75WOmv4nhwtF9XbZ2Mp7iH0pOeYUa2EUWbyb/sf5RHYYmR+oobMz74NEZEhiiPMCEI1yGfwp12pKJr821vqCslEyTKomsNuEN9C/X1eD8fyh/qPN4iTzTb764AFFWNBYXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779914671; c=relaxed/simple; bh=Yte/I3QnLimF0b1V3dsM19sZEZSAoxEpCXB0BJLfhZg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pTF0YhYE6stzujT+ooKM2JYxLXd+OQutZ1Yhop2R010Q/CgW2QWNLS1xQ0ie//Hhryfu/+SbHzszK2ANVOuUZhVMWLJ1rREiOxmLVae2jd7bj7R/bc7rO6AJSXTlOIRbdHQoUjTWaD9UiiWMGlilBI4MIW5GO5zz4BOgsllREpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org; spf=pass smtp.mailfrom=wbinvd.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b=gGQIJdlO; arc=none smtp.client-ip=74.125.82.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b="gGQIJdlO" Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-2ef2a1cc06dso6063927eec.0 for ; Wed, 27 May 2026 13:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1779914669; x=1780519469; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DIWJ2TCqktBlzCo70MV4AXWtezG3P2j/gmZ0tt2YvNE=; b=gGQIJdlO+7yIQr/xexGfj0ZAFJN4+9qkHPa90rvKyf1JYC8NeIUjR2nwGmkocGk90h WgZ6BsQGWcftB7JGM1ODJS02Pmzj4aI3RVDUCbPBE+W0F+uEFDZtZDuV80OgFP2EZBBk VLlMMeaCF10Ukt44L+GVofotSsvWoP4d9seXD6WbeY1pDybzbmN0jL4tKs8Jf/YTLKt+ 8EnDNYedYDFk0Be6/d19laXp+G0Y/OMrGln/CRF/NHW5SzyNJ02+1FmnqCV3wX8nC7Cc CK4/3Q4IkiE/8paBBsx3cnrMVgHFG45+WRH2EeicWnDMh1hgrd5cc2atAjM2hVf5yCub vprQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779914669; x=1780519469; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DIWJ2TCqktBlzCo70MV4AXWtezG3P2j/gmZ0tt2YvNE=; b=NN+FuVNJIfstKKrIcZ6I6S14JTTklOvz8CE1zOxr2HvNa6VvmHlIiVvIi96WCtoqsq /VwsPzIBE2Jg9WgwhG+iWF6nli9R/633pxr6zixxAIohuhaFygYu6xR5gZw4dtR/uoh1 jxbXW6usoK7dFB8EKYY8m8UU26YbXtBrfHST+H+HSyYgGyZNooMaq6Nu/bDWXe2c3V2W HSCTi9Yh3M5A9XONaxqVeaxh21w3jbc75C3Ee1i5N/Tbm3QUbZji40T6xhfKmODH9R/8 01ifLpaFMSyYgaXtbsbWAurLFxLG3TFkW9EL8ZoxV6D8xZDQ/a1vchmb9PhEXIHnuH6e WunQ== X-Gm-Message-State: AOJu0YzBWvyG4RaGWDz4dAszY1Nt1gMaBVceIm+AZPk7fHo3AHLynPYA u43hk9btAvbaLDRyOs6REGgHoTXsWqHD5atPbSyCgxC8PeIKgEbT5+LENZNxFH5Y95b6axiz+6L l4CBs X-Gm-Gg: Acq92OH/9pEMr6Ovi4MK+UH3psbd+GFyRBBOY/aH+d+xIoSJIdkIESvljdbYhJWmTpp LuXGtKNb276J7ttQnNyOYx6WU6fQRYHj1BVnQ7NDf2wJWchFcZpEOOB+BDJv+Cvrbbh8ADvbNaq 9oyL3Y6Gq65Zus2mYY7SlszaZ3kO9QATKt11nDE/ppnCMbZVm0QUIc0/7rZF6AnM7FKozeE7N3b y+KidkjnZ7pc9e7FwxM9oJn/prcbi27TZtRf4+QyHxfKJaglqKIGbiS+h6vfI9xOkpwNfDM2fbk p/yJ6xod5HZnkN1fA9DthgUlor4nEfcE1qDOAUS7UmDJaxj6HBXsQBoC94jlFNAA8+ZPhxJRY+C jPMaFIJvdTJ9F7SMen1zJ5ymDXLoIY7UD8nX0huTbNhDnYaHttlisyVqxVs9gIyIFydgB3UyYCI 60PODzFZsmxWPBxWFp8mFPf0pUBkm6Zu5sHk7C X-Received: by 2002:a05:7300:2324:b0:2ff:c84d:44d2 with SMTP id 5a478bee46e88-3044905ffe5mr12641208eec.12.1779914668616; Wed, 27 May 2026 13:44:28 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:3c4d:81ff:f9f3:f0fd]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30481ad4cd3sm11308565eec.27.2026.05.27.13.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2026 13:44:28 -0700 (PDT) Date: Wed, 27 May 2026 13:44:25 -0700 From: Calvin Owens To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Petr Mladek Subject: Re: [PATCH] lib/test_crash: test module to trigger kernel crashes Message-ID: References: <17c774c9032b5ea214b3ceb0c0a008caf2610e30.1779896981.git.calvin@wbinvd.org> <20260527114002.d71a5a5f8cb4c5b258c3e39f@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260527114002.d71a5a5f8cb4c5b258c3e39f@linux-foundation.org> On Wednesday 05/27 at 11:40 -0700, Andrew Morton wrote: > On Wed, 27 May 2026 09:56:44 -0700 Calvin Owens wrote: > > > This test calls panic() from various execution contexts in the kernel, > > so the user can see if a crash trace is successfully emitted. > > > > This is useful for testing console drivers, and can help rule out issues > > with the console itself when silent reboots or hangs are observed on a > > particular system. > > Well you aren't the first to write a patch which crashes the kernel ;) Thanks for taking a look Andrew. In answering some of your questions, I ran across drivers/misc/lkdtm/ which already does all of this and more... oops :/ So we can drop this, unless Petr sees some value to this new one and wants to chime in. Thanks, Calvin > > --- > > I shared this upthread in [1] where it turned out to be useful for > > netconsole. Petr suggested it might be useful for others, so I've > > applied his feedback and cleaned everything up a bit more too. > > > > It's a superset of what 'echo c > /proc/sysrq-trigger' does, but > > extending that interface doesn't seem practical. > > Please fully expand on this? > > > The write() implementation requries the entire string be written in a > > single syscall: this is pretty common for these debugfs interfaces, so > > it didn't seem worth the complexity to handle partial writes. But I'm > > happy to do so if somebody cares :) > > Some of the above is useful background and deserves to be above the --- > separator. > > I'm not really liking the "crash" name. We already have one of those - > a kexec crashdumping thing. Maybe "force_panic" or someting. > > > > lib/Kconfig.debug | 18 +++++ > > lib/Makefile | 1 + > > lib/test_crash.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++ > > Some Documentation would be nice. > > > --- a/lib/Kconfig.debug > > +++ b/lib/Kconfig.debug > > @@ -1385,6 +1385,24 @@ config TEST_LOCKUP > > > > If unsure, say N. > > > > +config TEST_CRASH > > + tristate "Test module to trigger crashes" > > Some debugfs dependency needed? > > > + help > > + Expose a file in debugfs which triggers a panic() call in > > + various kernel execution contexts. > > + > > + $ cat /sys/kernel/debug/test_crash > > + irq > > + [...] > > + $ echo "irq" > /sys/kernel/debug/test_crash > > + Kernel panic - not syncing: User triggered crash in context irq > > + > > + This is useful for testing console drivers, and can help rule > > + out issues with the console itself when silent reboots or > > + hangs are observed on a particular system. > > + > > + If unsure, say N. > > + > > endmenu # "Debug lockups and hangs" > > > > menu "Scheduler Debugging" > > > > ... > >