Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1824534rdf; Sun, 5 Nov 2023 16:13:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFypqvspyc0r3jwWMhHEWnKc1Kv8CEj6DPHnuMrlDeUGNpiMyMUIrCLJcibNvLUer8g+U2t X-Received: by 2002:a54:4819:0:b0:3af:e451:9e6 with SMTP id j25-20020a544819000000b003afe45109e6mr28868949oij.15.1699229625036; Sun, 05 Nov 2023 16:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699229625; cv=none; d=google.com; s=arc-20160816; b=u80cSAbtkR5pPjBKj9CxW/TCmesIPtoDn3tv3ywywv5Yh6b0yNxoA300TcOm85qUUE 4Vh8R5+qMxbYbOn/dGvJhsEeofeB5onRVbu32zrR9ex/bPCSXpx1xIuEXzqaWeKCYFnl LMnjffZp/qO8eO8ePGwt05KKtVSC6Gf0Y9WuBbNfhhZZFXiykFU1iS/K5MpUR2JXiwni XHyk8P9kDTKVactY+FTPtk0LXODoCsVBscjKcZX4HrHpMwlJARLyOOhVTOevoSg5Vxug fZ/OiVPmAVTxbToCo4eVgOcC2Uo8sHNmLpUP8SJFse/j2I16qg+fEpTk/y8kjy9NY/EW MSwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=cXAJ9BZo5drVO9Ek1zL6cxPlBwfYa/GlMFz6PSVAW64=; fh=28dNCNyYMvbiW9fHoXHwvfesjIDHciXVBmco/0BG2U8=; b=Ahxec8yDjuU7+cphcsOKNZj4j/9SWhWSdpfXIgwBKJM0UOo7xWxHi9BvH1IQwYrkiw EWRQ1h686sU2bXy3pTu4QWnnKhaDnz4PzMx6dQO2s9X5/GJ1f0/pwZ31Glzj/oVJJIH6 GJUlxxNLHI0TtgDFeIfhP4ie7ivwvJfAw/sAa1p03xyUC4wk7GMTWZqAYQaLJLiz9ftG JGICKy4MgLLHB2Sg5/to/Xr7F2rGzK7+u1E15knJnC6zf+F7LKoqV3yVzla67fQ4TOLE 4nNybTdNcuLCfe18SijosvphdvfbZjqGguTpN0U823ISqJsDOdwdjzA8G3CuQuZmWDLC ZCaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XbwclX53; dkim=neutral (no key) header.i=@linutronix.de header.b=YAmlV74+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id c13-20020a056a00248d00b00690f8063627si7051893pfv.38.2023.11.05.16.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 16:13:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=XbwclX53; dkim=neutral (no key) header.i=@linutronix.de header.b=YAmlV74+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B5D2580AC8CD; Sun, 5 Nov 2023 16:13:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbjKFAN1 (ORCPT + 99 others); Sun, 5 Nov 2023 19:13:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKFAN0 (ORCPT ); Sun, 5 Nov 2023 19:13:26 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1685393 for ; Sun, 5 Nov 2023 16:13:23 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1699229600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cXAJ9BZo5drVO9Ek1zL6cxPlBwfYa/GlMFz6PSVAW64=; b=XbwclX53fKHatfiJi+lC0QjE5YW9TW7PPHKSSdyJy1XbsBMln+Jv6EVhqGrT8nQIoTi38h eEJ4YAV6WKxphWcYtlgxV2Xw+yJPrREy3PT4Qlpo9CuAEww4C5bBKc7cVoVJfPbReWWCc2 aOTTumF86m62nDAG2D+EFyDXmjRW2ZL6AAbNNWZlUObEWinEPmXb3tPWN7jj+oA1y39a/M A8p922udvyzo8Vne3o/LkdG4IO664+lPpHAqIzVO++wpzKuuiX8exMmS2PLAUYNlbSrlJV i3eHgM6c7q4gu/E8jIoJBG64zMkO48u63oXNgdU15L54JaiRZCVc6JGf5182aA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1699229600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cXAJ9BZo5drVO9Ek1zL6cxPlBwfYa/GlMFz6PSVAW64=; b=YAmlV74+FJQTd1bifrk1V2sExI5NtKC2uSPt9g6Mbcn+NmAX2ncOu24fl/DafkKMeRY55G Wd9sr04P6gHMe2Bg== To: Ben Greear , Linux Kernel Mailing List Cc: Rodolfo Giometti , Andrew Morton , Greg Kroah-Hartman Subject: Re: [PATCH/RFC] debugobjects/slub: Print slab info and backtrace. In-Reply-To: References: <20231103013704.1232723-1-greearb@candelatech.com> <92a422d6-76c8-ce25-c331-0718b73dd274@candelatech.com> <875y2gi33n.ffs@tglx> Date: Mon, 06 Nov 2023 01:13:19 +0100 Message-ID: <8734xjivs0.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 05 Nov 2023 16:13:42 -0800 (PST) On Sun, Nov 05 2023 at 09:40, Ben Greear wrote: > On 11/5/23 8:20 AM, Thomas Gleixner wrote: >>> 16147 Nov 02 17:28:25 ct523c-2103 kernel: worker_thread+0x38a/0x680 >> >> Can you please provide proper kernel dmesg output next time instead of >> this mess? > > You are complaining because there are a few extra tokens put in this > by journalctl? Superfluous information is just distracting :) >>> ODEBUG: free active (active state 0) object: ffff888181c029a0 object type: timer_list hint: kobject_delayed_cleanup+0x0/0x140 >>> WARNING: CPU: 1 PID: 104 at lib/debugobjects.c:549 debug_print_object+0xf0/0x170 >>> CPU: 1 PID: 104 Comm: kworker/1:10 Tainted: G W 6.6.0-rc7+ #17 >>> Workqueue: events kobject_delayed_cleanup >>> RIP: 0010:debug_print_object+0xf0/0x170 >>> debug_check_no_obj_freed+0x261/0x2b0 >>> __kmem_cache_free+0x185/0x200 >>> device_release+0x57/0x100 >>> kobject_delayed_cleanup+0xdf/0x140 >>> process_one_work+0x475/0x920 >>> worker_thread+0x38a/0x680 >> >> So what happens is: >> >> pps_unregister_cdev() >> device_destroy() >> put_device() >> device_unregister() >> device_del() >> put_device() <- Drops final reference to dev->kobj >> schedule_delayed_work() >> >> worker thread: >> kobject_delayed_cleanup() >> device_release() >> pps_device_destruct() >> cdev_del(&pps->cdev) >> kobject_put(&cdev->kobj) <- Drops final reference >> schedule_delayed_work() >> init_timer(&cdev->kobj.release.timer); >> start_timer(); >> ... >> kfree(dev); >> kfree(pps); <- Debug object detects the active timer to be freed >> because cdev and its kobject are embedded in >> struct pps_device. >> >> pps_device_destruct() is unfortunately not on the call trace of the >> debug objects splat anymore stack because kfree(pps) is a tail call. > > So, is this a real bug, or just false positive? Freeing an active timer is obviously a bug, no? >> So yes, that collected stacktrace is helpful. > > The one I added, or was the original code enough to find this? The one you added. Collecting this information is useful when the object tracked by debugobjects provides a hint which does not give any information about the source of trouble: timer_list hint: kobject_delayed_cleanup+0x0/0x140 It points to the work function, but that function is useless to figure out where the kobject belongs to. So the extra stack trace during init provides the missing information. Though I just looked at the patch again. This part is problematic: > + trace_handle = stack_depot_save(entries, nr_entries, GFP_NOWAIT); This breaks on RT as you cannot allocate with a raw spinlock held. Let met think about that. Thanks, tglx