From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EFC8C4743C for ; Mon, 14 Jun 2021 14:25:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72DCA611C0 for ; Mon, 14 Jun 2021 14:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234465AbhFNO1X (ORCPT ); Mon, 14 Jun 2021 10:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232809AbhFNO1U (ORCPT ); Mon, 14 Jun 2021 10:27:20 -0400 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C58C061766; Mon, 14 Jun 2021 07:25:17 -0700 (PDT) Received: by mail-lf1-x129.google.com with SMTP id p17so21407130lfc.6; Mon, 14 Jun 2021 07:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lKRSk5HzbOmXuCA3rliZmeLLBLcB5mMmfL/kTP5W7uo=; b=HbMu/AK0B3ZfYZGiK5bqwr12vcZCA4Wfjhr3rxx6x4APBSV5+cOcztbmz4h5XipUdL MhyYGmxgkp9icxgpqfvhZt5G/HyEBlVLbaFbNDonII4Bjh4ELvWIMtUjSj7AHco8rlUt D4GVfGRX6NZl3JLyPa7hbtokhQlnFj25aGZhi5+zWRAsrIYc7kRcaW4CS3TwYubyBV9T n1AZtghp3yzkw3muaYmf1ZqIBw7NqRG3rW8kMjS4YxPEnW6r794JlDrYZCKIvfPzC8Sa c28L1eLRnhEhsJazcJjbriUBxugYbTvN1Zal+/7mOqwxT0ITT5eOmcRDNnP9TrClphXb HPjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lKRSk5HzbOmXuCA3rliZmeLLBLcB5mMmfL/kTP5W7uo=; b=qUh+W/20i5Tj12ZF+ZlFIv2yypOPXWaKj7rsdFxe3sq4J79PJ4wH8mVIVZmDf0hXXh UsIRWtQDJlyZxI+bIe/PM5LKxfAUct1Yo+kU/oAidheMh/vkuHyYPnVE27LDLhhRY6gi gPabXmMIg1+exQrnSM5RQsdw83hGUyg66uJGN6BfGavqYsYBHS9MVXwteYYusQmqmiqT K7QI4qFBJbJ1InhLym02VDaJgInDefGfNgPXFYN8/uZP/7toP9Glzfx0nXa9ti3rO1hy 8WyjXzkRvfY+xVaJPPzM1ziX3C4y9GpVW+bCC7U+WhE3jfbY3NWeuLHow0B+xSpBA/ws QotQ== X-Gm-Message-State: AOAM531eOF+YtLoaFEFdU9srWT2NaPQIcM/rtKoSUDGpj3qviFuxtkdM oDnC1pBzk1h94Md9TPhQWUo= X-Google-Smtp-Source: ABdhPJz0cLTrRyc7MvmhGfJeBleE0yG9ThwWkjdAMqFhKJLurHNe6u0i14XCh5e9VyDIYl8Ns74Atg== X-Received: by 2002:a05:6512:ba3:: with SMTP id b35mr1580844lfv.7.1623680715685; Mon, 14 Jun 2021 07:25:15 -0700 (PDT) Received: from localhost.localdomain ([94.103.229.24]) by smtp.gmail.com with ESMTPSA id z16sm1498670lfs.24.2021.06.14.07.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 07:25:15 -0700 (PDT) Date: Mon, 14 Jun 2021 17:25:12 +0300 From: Pavel Skripkin To: Dongliang Mu Cc: alex.aring@gmail.com, "David S. Miller" , Jakub Kicinski , linux-kernel , linux-wpan@vger.kernel.org, netdev@vger.kernel.org, stefan@datenfreihafen.org, syzkaller-bugs , syzbot+b80c9959009a9325cdff@syzkaller.appspotmail.com, Dan Carpenter , Greg KH Subject: Re: Suggestions on how to debug kernel crashes where printk and gdb both does not work Message-ID: <20210614172512.799db10d@gmail.com> In-Reply-To: References: <20210614163401.52807197@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 14 Jun 2021 22:19:10 +0800 Dongliang Mu wrote: > On Mon, Jun 14, 2021 at 9:34 PM Pavel Skripkin > wrote: > > > > On Mon, 14 Jun 2021 21:22:43 +0800 > > Dongliang Mu wrote: > > > > > Dear kernel developers, > > > > > > I was trying to debug the crash - memory leak in hwsim_add_one [1] > > > recently. However, I encountered a disgusting issue: my > > > breakpoint and printk/pr_alert in the functions that will be > > > surely executed do not work. The stack trace is in the following. > > > I wrote this email to ask for some suggestions on how to debug > > > such cases? > > > > > > Thanks very much. Looking forward to your reply. > > > > > > > Hi, Dongliang! > > > > This bug is not similar to others on the dashboard. I spent some > > time debugging it a week ago. The main problem here, that memory > > allocation happens in the boot time: > > > > > [] kernel_init+0xc/0x1a7 init/main.c:1447 > > > > Oh, nice catch. No wonder why my debugging does not work. :( > > > and reproducer simply tries to > > free this data. You can use ftrace to look at it. Smth like this: > > > > $ echo 'hwsim_*' > $TRACE_DIR/set_ftrace_filter > > Thanks for your suggestion. > > Do you have any conclusions about this case? If you have found out the > root cause and start writing patches, I will turn my focus to other > cases. No, I had some busy days and I have nothing about this bug for now. I've just traced the reproducer execution and that's all :) I guess, some error handling paths are broken, but Im not sure > > BTW, I only found another possible memory leak after some manual code > review [1]. However, it is not the root cause for this crash. > > [1] https://lkml.org/lkml/2021/6/10/1297 > > > > > would work. > > > > > > With regards, > > Pavel Skripkin With regards, Pavel Skripkin