From owner-svn-src-all@freebsd.org Sun Apr 12 18:04:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83D162C4A81; Sun, 12 Apr 2020 18:04:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 490flT2v8lz4Rls; Sun, 12 Apr 2020 18:04:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EA185A88; Sun, 12 Apr 2020 18:04:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03CI4LGX048390; Sun, 12 Apr 2020 18:04:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03CI4Kls048385; Sun, 12 Apr 2020 18:04:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202004121804.03CI4Kls048385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 12 Apr 2020 18:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359829 - in head/sys: amd64/conf conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys: amd64/conf conf X-SVN-Commit-Revision: 359829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2020 18:04:21 -0000 Author: cem Date: Sun Apr 12 18:04:20 2020 New Revision: 359829 URL: https://svnweb.freebsd.org/changeset/base/359829 Log: Add queue(2) debug macros as build options Add QUEUE_MACRO_DEBUG_TRACE and QUEUE_MACRO_DEBUG_TRASH as proper kernel options. While here, alpha-sort the debug section of sys/conf/options. Enable QUEUE_MACRO_DEBUG_TRASH in amd64 GENERIC (but not GENERIC-NODEBUG) kernels. It is similar in nature and cost to other use-after-free pointer trashing we do in GENERIC. It is probably reasonable to enable in any arch GENERIC kernel that defines INVARIANTS. Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/GENERIC-NODEBUG head/sys/conf/NOTES head/sys/conf/options Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Apr 12 16:13:05 2020 (r359828) +++ head/sys/amd64/conf/GENERIC Sun Apr 12 18:04:20 2020 (r359829) @@ -96,6 +96,7 @@ options GDB # Support remote GDB. options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones Modified: head/sys/amd64/conf/GENERIC-NODEBUG ============================================================================== --- head/sys/amd64/conf/GENERIC-NODEBUG Sun Apr 12 16:13:05 2020 (r359828) +++ head/sys/amd64/conf/GENERIC-NODEBUG Sun Apr 12 18:04:20 2020 (r359829) @@ -40,3 +40,4 @@ nooptions FULL_BUF_TRACKING nooptions COVERAGE nooptions KCOV nooptions MALLOC_DEBUG_MAXZONES +nooptions QUEUE_MACRO_DEBUG_TRASH Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Apr 12 16:13:05 2020 (r359828) +++ head/sys/conf/NOTES Sun Apr 12 18:04:20 2020 (r359829) @@ -414,6 +414,18 @@ options DDB_NUMSYM options GDB # +# Trashes list pointers when they become invalid (i.e., the element is +# removed from a list). Relatively inexpensive to enable. +# +options QUEUE_MACRO_DEBUG_TRASH + +# +# Stores information about the last caller to modify the list object +# in the list object. Requires additional memory overhead. +# +options QUEUE_MACRO_DEBUG_TRACE + +# # SYSCTL_DEBUG enables a 'sysctl' debug tree that can be used to dump the # contents of the registered sysctl nodes on the console. It is disabled by # default because it generates excessively verbose console output that can Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sun Apr 12 16:13:05 2020 (r359828) +++ head/sys/conf/options Sun Apr 12 18:04:20 2020 (r359829) @@ -55,17 +55,19 @@ DDB_CAPTURE_DEFAULTBUFSIZE opt_ddb.h DDB_CAPTURE_MAXBUFSIZE opt_ddb.h DDB_CTF opt_ddb.h DDB_NUMSYM opt_ddb.h +EARLY_PRINTF opt_global.h FULL_BUF_TRACKING opt_global.h GDB KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h KLD_DEBUG opt_kld.h +NUM_CORE_FILES opt_global.h +QUEUE_MACRO_DEBUG_TRACE opt_global.h +QUEUE_MACRO_DEBUG_TRASH opt_global.h SYSCTL_DEBUG opt_sysctl.h -EARLY_PRINTF opt_global.h TEXTDUMP_PREFERRED opt_ddb.h TEXTDUMP_VERBOSE opt_ddb.h -NUM_CORE_FILES opt_global.h TSLOG opt_global.h TSLOGSIZE opt_global.h