Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1199882pxb; Fri, 21 Jan 2022 12:05:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXF4WEX+iMlKx6sFoL1pjZuDrfmqs40XkaS2WustYjXNBxEEMvZp/ChA+kWmUeYvAH/fl2 X-Received: by 2002:a17:90b:4a45:: with SMTP id lb5mr2297478pjb.220.1642795553077; Fri, 21 Jan 2022 12:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642795553; cv=none; d=google.com; s=arc-20160816; b=Rc22eWIxPtvRq/bnQ5u23Dfc9HBTvdZIbtyWLqYpuQSIYffspw+O6/XXc7fPXpXDxA 8D7SOmhWik3/RTfH4Qf/LjI8SfxKdPgV7ze8tmAQ6AA2c93VWxABhWv5+qolh7d6D7iC MvX98kf0+4EK1NpFoKkX6wNpul+RmDMwLt9PXU03fWXHkC2co6e7V2LPZtJfKDkjCeCo TqYnTSl3DLF3GRVyOhVlNJLVfd7wywGp95l4+/VrGSskvDQvpwK4dB8Ys+WVKcgmfpx1 RdaJLV7EX7KMvirHQGuhfw33N72gyO5FS0UdXLxf1DgORoAWjKJf+Nj0LfOrnaR96Xd0 mvQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pMBGEfdUp32njygoehJuHz49mNSt4sh9Umtdihp9UCc=; b=q3H+XkqRGJ0PifOKEV7K01aF9+u557enRI2zuGWtn2vjm9Y/kb3NYlVGYQcA+bq9TS nNhfUKh/xF0U2fsOr92BmPecaUp6zAm728hB22CS6BqC6INUIJK/LVUYjPXOhBR6CnYJ Cc3lunbPBtzYAtZjOM7oL8kYeTLDxoBS9GJzuY145/FBt8dW5hlwem+dGj36/4NBaYUy H5+4q3cDFrM31KDKi7nxrRQ6hQcQbL9KoBp2ps4AowB2lxw4NnpkyPiPoBXS2lBgR/sy feEGa3BczQuZN+9G3WwddAD31M0UXNAxs2sB5vhfmegf3xf74nPqmdm7tLoGJfpPAMPG +JYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/T6m8DG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si9489422plg.343.2022.01.21.12.05.40; Fri, 21 Jan 2022 12:05:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/T6m8DG"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245312AbiASVVk (ORCPT + 99 others); Wed, 19 Jan 2022 16:21:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39004 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbiASVVc (ORCPT ); Wed, 19 Jan 2022 16:21:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642627291; 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=pMBGEfdUp32njygoehJuHz49mNSt4sh9Umtdihp9UCc=; b=Z/T6m8DG0F0/abOtWSvTGhO4fd1vL3aJ/q3q7ftR4Nyy9O3CgKBrGfJznb8Eu7FUWsCuKs 75Url5mf/XiCNEWKwaY8xQIXZdYzjMpUXgwwWkxqInrDQ60tRV3kY9kgyx5Dyf8J1HBVTF DxTAW5tO9/1Pc7DTxdJmBq6dAmztJ2k= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-256-XCEShU3fOVS0kZBcVqYIPA-1; Wed, 19 Jan 2022 16:21:30 -0500 X-MC-Unique: XCEShU3fOVS0kZBcVqYIPA-1 Received: by mail-qv1-f69.google.com with SMTP id gg10-20020a056214252a00b0041eeb1c2684so3999942qvb.21 for ; Wed, 19 Jan 2022 13:21:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pMBGEfdUp32njygoehJuHz49mNSt4sh9Umtdihp9UCc=; b=2iGBSnVwvymITfV1YaT7CxT/XEJCQ686il+a1ERdfvGQu4v8zTmMyQEJYxlSsfBMy6 +ZIDlEut/CpXsnivs3RovTmkYkPf8w9I4sKrkMKAlhp/EG4aPs8LOJKSxEwfef64wXF2 wUB3Sx3HUNMNgoPY3JIoiVsnqwNse2AKuZuwMR7rjImrTtX9rxlF3WZpAs3V88MYnZ8V AK+TMEG/B3/n8de5iBEUltUVieVfNlcAiAFPmGet5dw97iBZrGKzAYo1tnN8zyfjf+fR MmZMQkRRgGNN1a2G6NWu5ViN9mgQnzSIQNl2FxQFAQ+kMjEkYiBUYtd30Q9EFcxw0Xqe Negg== X-Gm-Message-State: AOAM532wa7L4M/Dlk5yIA6p5IjW1zDX4af0NUWzgSR53qboXsgT3bR/R lTEeL084NuhfzbyD8ZZ1OuVQzgJzQ9m+V03/NBQuP94O4bSRIlvJ5VZQFT9KSe0cUlh90YTYxNZ 1l93Em8bn97oAzsWM6LIJwpVp X-Received: by 2002:a05:622a:164a:: with SMTP id y10mr26483454qtj.441.1642627289331; Wed, 19 Jan 2022 13:21:29 -0800 (PST) X-Received: by 2002:a05:622a:164a:: with SMTP id y10mr26483444qtj.441.1642627289051; Wed, 19 Jan 2022 13:21:29 -0800 (PST) Received: from treble ([2600:1700:6e32:6c00::c]) by smtp.gmail.com with ESMTPSA id v18sm398742qtw.14.2022.01.19.13.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jan 2022 13:21:28 -0800 (PST) Date: Wed, 19 Jan 2022 13:21:26 -0800 From: Josh Poimboeuf To: Kaiwan N Billimoria Cc: Linux Kernel Mailing List , Chi-Thanh Hoang Subject: Re: Issue using faddr2line on kernel modules Message-ID: <20220119212126.aydgx62abbngumwy@treble> References: <20220117194836.vj2rxr3wocrtdx7k@treble> <20220117202751.bmwvfsnqxokob6d2@treble> <20220118175239.lqxi2ycgeusk5pxl@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 19, 2022 at 09:27:18AM +0530, Kaiwan N Billimoria wrote: > On Tue, Jan 18, 2022 at 11:22 PM Josh Poimboeuf wrote: > > > > On Tue, Jan 18, 2022 at 08:10:28AM +0530, Kaiwan N Billimoria wrote: > > > Hi Josh, > > > > > > Actually your first patch - the one you mentioned had other issues - > > > worked perfectly when applied: > > > > > > scripts/faddr2line ./oops_tryv2.ko do_the_work+0x16f/0x194 > > > do_the_work+0x16f/0x0000000000000194: > > > do_the_work at <...>/oops_tryv2/oops_tryv2.c:62 > > > > > > The second one still failed in the same manner: > > > > > > scripts/faddr2line ./oops_tryv2.ko do_the_work+0x16f/0x194 > > > bad symbol size: base: 0x0000000000000000 end: 0x0000000000000000 > > > > > > So, is it possible to fixup issues with the first version? > > > What are these issues? > > > > The first patch basically reverts the fix in commit efdb4167e676 > > ("scripts/faddr2line: Fix "size mismatch" error"). That would be nice > > as it's simpler and more robust, but unfortunately it would cause a lot > > of "size mismatch" errors with vmlinux symbols. > > I see... if it comes to it, could there be a workaround where the > script detects a vmlinux image and works in a given manner, > else in this manner for other images - in effect, for modules? I think I misspoke about the vmlinux behavior being different, so I don't think that would work. > > Can you give the output of 'nm -n ./oops_tryv2.ko'? There must be some > > text symbol immediately after the do_the_work() symbol which is either > > out of order, or part of another section. > > > > Is do_the_work() in the .text section? > Yes... > Here's the output I get: > > $ nm -n ./oops_tryv2.ko |grep -C5 do_the_work > 0000000000000000 r __func__.24215 > 0000000000000000 r __param_bug_in_workq > 0000000000000000 D __this_module > 0000000000000000 r _note_7 > 0000000000000000 T cleanup_module > 0000000000000000 t do_the_work > 0000000000000000 t do_the_work.cold > 0000000000000000 b gctx > 0000000000000000 T init_module > 0000000000000000 t try_oops_exit > 0000000000000000 t try_oops_init > 0000000000000008 b t1 > $ > > BTW, here's the code: > https://github.com/PacktPublishing/Linux-Kernel-Debugging/tree/main/ch7/oops_tryv2 Ok, it looks like the symbols aren't sorted like the code expects. I need to do a more robust fix. -- Josh