Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2728283pxb; Mon, 17 Jan 2022 04:42:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTfd59afUPOI8vVwnsDJ6kQrKW8XmllswqrEmTYz1JnmDelPhMbcw+KOx25uwcfwKmcqK1 X-Received: by 2002:a63:6ece:: with SMTP id j197mr18864821pgc.322.1642423352774; Mon, 17 Jan 2022 04:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642423352; cv=none; d=google.com; s=arc-20160816; b=VzzB3Yt7ivKBX35TRUrgMX2yUKiLsJHfa+ZxuUDWr3AFmLI+7bn1KDNYb6UlxZTN8+ 4V0F31WBBgVeQr7f1YR1gnGpJSm59U8fYDyyZNOkmkExVK3/FuqZ2UvIbSiCsOqNTTRl elpE5DbtJPR4FBBFUN/JE+ar6ZDFPpHAm23YGXW3qZ9KRf6bHsKZeydD5H1Tx77a+kXm ShiAmGKK+hkPawVNqdwxk6La6wbiWtxEcsvuUJoPsNBOhRrdkS7m046zIct8babqXZtH DYJoxBPczfp4j12IuVLDHCpVjZpG5ywPaKo5O7xzEb/aMW7BATgKK66MUOs0fWxxNZWl 8Q6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:mime-version :dkim-signature; bh=EGUJeiLB/ZPJRzDyzkwCPPzWg09D1+bq1HUpUmr8PxU=; b=MCkat3667jkhAURpvkjuxEKpQhZHvmOfAP9Om18E20ok2mBCJFAWVsOsm+sPxSFAUh tn3FQMPg0wWTHNpJrYcdDW+uyy8QfUfXav2nFZbdgi9+cgVUwQv22bDnhZDRQF3XdRpY YQHdKGP/NvwT7hlpwM368LB5RkQ8R0IwkEFYvJTFWhuk6IjyFhMvbS/Yi3B09eg4tSxT qb46kGAKlR3QSC3ejS9KttHCv4DcvK2aG2KX8HelZd6EmPSx1jmrRNG001IxKm2Z3CTl vspusNAnxVfUEQDt1qe3VNXoF3ImZdDCelD2+bxDt3QnCPPqpl4C14Dh/72xtiQSfvjh gp1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=f6lgSAgg; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si14609822pgr.468.2022.01.17.04.42.20; Mon, 17 Jan 2022 04:42:32 -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=@gmail.com header.s=20210112 header.b=f6lgSAgg; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237120AbiAQE5h (ORCPT + 99 others); Sun, 16 Jan 2022 23:57:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237098AbiAQE5d (ORCPT ); Sun, 16 Jan 2022 23:57:33 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 367FCC061574 for ; Sun, 16 Jan 2022 20:57:32 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id j7so12037175edr.4 for ; Sun, 16 Jan 2022 20:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=EGUJeiLB/ZPJRzDyzkwCPPzWg09D1+bq1HUpUmr8PxU=; b=f6lgSAggijjILJia0DzHVLMwMwk7oYL3zRnoTBcXP/i35YHHrcZ7EM0wBVF+4UuaJ8 ybFKaroRdcV5882qfqINNZfYMw1T2BP4Xui2oFghguPCYzuBu8os0WXRm4Tj/aoihLOb mqAqKKt8xBLigi64q5wbrPCFqr4wNdVhb/LGpMPqZ0JrERPqdNko+IncqQJk5NsjIjSQ xMnZ7GrEo4kqpcWSfTE/lR++y00aekdUDQbCn6B+i+vEVJCoWRtQQrTsHW+zWs4oKSL1 6SEb//XKvchG+DXjxd+NSSQ3ijrjkkq5fPpdjteZeNB6m++AsYhk35m52/mnuFKEUkzz 1M9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=EGUJeiLB/ZPJRzDyzkwCPPzWg09D1+bq1HUpUmr8PxU=; b=z1BhvF+ZrNsHp5sCdHE1UXx2r8fpF1pNzQi2zOtMhVOeJ2oFOhjpFObJgNBCdV0A01 1NciRF7kz645jzvKWjrFVBjgW0Q9dN7lftFwEoj1cERnstbbOBbRNEKKhjK6TBXFrWQJ CGlrRXvqG9+WGB3rMGlGkSRHpNcjxCL1wey82Tcg2RsLATJ0Nqt84Rhym3gRTXBFGZjZ ysif+P6Q+n3/IiEoh1hHXKaNXs4w6H74BHL8OO5FSHBcrNO4eEYQnbsMDqmVNsPQSrb+ mA3FdYi6TBNe/VNpACPFDnFu162ojos6z79+am5mNDVS9Re2sv5a0wQQ2sIdQ3lTMUlE XgJA== X-Gm-Message-State: AOAM530Tu6JIOybRmtcPygobE/pIc9VKfXpWwYq5Xx/p9RIpffgtqGEq Q3wbq4UYnXNEplzteKh75werPSBuxGl33eZIrfBrA6OqKyk= X-Received: by 2002:a17:907:8687:: with SMTP id qa7mr15101880ejc.106.1642395450332; Sun, 16 Jan 2022 20:57:30 -0800 (PST) MIME-Version: 1.0 From: Kaiwan N Billimoria Date: Mon, 17 Jan 2022 10:27:14 +0530 Message-ID: Subject: Issue using faddr2line on kernel modules To: Linux Kernel Mailing List , jpoimboe@redhat.com Cc: Chi-Thanh Hoang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi there, Am researching using the cool faddr2line script to help debug Oops'es from kernel modules.. I find it works just fine when used against the unstripped vmlinux with debug symbols. My use case is for a kernel module which Oopses, though. Here's my scenario: I built a module on a custom debug kernel (5.10.60) with most debug options enabled... KASLR is enabled by default as well. A test kernel module Oopses on my x86_64 guest running this kernel with: RIP: 0010:do_the_work+0x15b/0x174 [oops_tryv2] So, i try this: $ <...>/linux-5.10.60/scripts/faddr2line ./oops_tryv2.ko do_the_work+0x15b/0x174 bad symbol size: base: 0x0000000000000000 end: 0x0000000000000000 $ (It works fine with addr2line though!). Now I think I've traced the faddr2line script's failure to locate anything down to this: ... done < <(${NM} -n $objfile | awk -v fn=$func -v end=$file_end '$3 == fn { found=1; line =$0; start=$1; next } found == 1 { found=0; print line, "0x"$1 } END {if (found == 1) print line, end; }') The nm output is: $ nm -n ./oops_tryv2.ko |grep -i do_the_work 0000000000000000 t do_the_work $ nm shows the text addr as 0x0; this is obviously incorrect (same 0x0 with objdump -d on the module). Am I missing something? Any suggestions as to what I can try, to get faddr2line working? TIA, Regards, Kaiwan.