From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1nK2hQ-0006U0-05 for mharc-grub-devel@gnu.org; Tue, 15 Feb 2022 13:37:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nK2hN-0006Sp-Rv for grub-devel@gnu.org; Tue, 15 Feb 2022 13:37:13 -0500 Received: from [2607:f8b0:4864:20::731] (port=33435 helo=mail-qk1-x731.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nK2hB-0006uv-Ie for grub-devel@gnu.org; Tue, 15 Feb 2022 13:37:04 -0500 Received: by mail-qk1-x731.google.com with SMTP id o10so18179652qkg.0 for ; Tue, 15 Feb 2022 10:37:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=M1TkA03797ErmRRAax5E51hGPbhiPabqP2EqV3g2HFo=; b=0ux0Itfe9ZWYJfRgOtg056SXaKWWfkuMFRYXODPryl0dgDVOlhPtkqhqkL8OF9Cynm 54kp4kG4G+1ziT9oYlAfXCXrop9/mVzE9QQagrRlc/sy8fB2vBpdAlyEBE7U1myJ3y0B ZBIsGbif4Bfh64iTDpEnxDcR5TKOkqO14+LDpUKacstm5FGrnej7UOS308XBV+xWLrMW aAn3Sk5xVQKfzZVJjb2UKrmXsgnzEWhEEYbdFptnTywhGgPzoKDklxXrpfCOGvv4LFsK 2MLnUPq02rV/BN7Qt8T0/7/BEAZy/R719AiXwqkJuv1sTp2u5sJ6aaZY+FKruZJy7aqz wbuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=M1TkA03797ErmRRAax5E51hGPbhiPabqP2EqV3g2HFo=; b=sjJPrsmFYBMu3iQXt/p9vt132HJvRrDlNi4sFK/UOjhZIELANJGTt4XOlOUcQfr0lM CmC2mHANP53aE29hJG+9qbgW+kXzEeMvyxb+Pa8VZVulCp9QCBHX0XD081AKsfo4uHMA xnWsS+ZvOpMgWfUBEez9aFANpnWrwvV6xX3LD7W1E+PY3dtT2qyt7uNM3SX58lyY59w1 ntUAey4Kb0QzRATrqu8cFfJlEW8g3vAHz6eqdSsPwNIK8ypwI7pmf0+S6lnR0/lJ+pk6 BLOzyu6a5C98NwfrNwhY/M4E59D4+bEwC0rbbto667XPsWmBxCSxSfymauCifxADh5jb e+9Q== X-Gm-Message-State: AOAM530Pw9Dk/+e8TbzI22aTvGTdlFe9zfFFWhe1dqjXLfRBzrRgV9P1 2odrz6qBBjVGzVN/g768dRuEXg== X-Google-Smtp-Source: ABdhPJylP6PE9HK7G6n41Qx2GShYuroWVf6PHiQM+6NR4Peduv1zWbpT3j4FNdt/JqAq67WrXXzF6A== X-Received: by 2002:a05:620a:40cc:: with SMTP id g12mr206069qko.308.1644950220473; Tue, 15 Feb 2022 10:37:00 -0800 (PST) Received: from localhost.localdomain (garza.riseup.net. [198.252.153.109]) by smtp.gmail.com with ESMTPSA id w10sm21320714qtj.73.2022.02.15.10.36.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 10:36:59 -0800 (PST) From: Glenn Washburn To: Daniel Kiper , grub-devel@gnu.org Cc: Glenn Washburn Subject: [PATCH 0/3] Fixes and enhancements for memory debugging Date: Tue, 15 Feb 2022 12:36:40 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::731 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=development@efficientek.com; helo=mail-qk1-x731.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.904, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2022 18:37:14 -0000 The first patch supercedes a patch sent earlier of the same subject. I've removed the #undef if --mm-debug is not passwed to configure. The idea is that even if --mm-debug is not passed to configure, the user should still be able to enable memory debugging by passing -DMM_DEBUG in CFLAGS. The second patch I found useful in dumping the memory allocation state from a module. And the third patch is a bug fix, without which enabling memory debugging leads to a certain infinite recursion crash (when also enabling grub_mm_debug). As an aside, this leads me to believe that no one has used this feature in a very long time (and is not currently using it). Glenn Glenn Washburn (3): configure: Properly handle MM_DEBUG mm: Export grub_mm_dump and grub_mm_dump_free mm: Temporarily disable grub_mm_debug while calling grub_vprintf in grub_printf config.h.in | 4 ++++ configure.ac | 6 ++++-- grub-core/kern/misc.c | 19 +++++++++++++++++++ include/grub/mm.h | 4 ++-- 4 files changed, 29 insertions(+), 4 deletions(-) -- 2.27.0