<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:51:43 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-12341] Make test-framework aware of kmemleak</title>
                <link>https://jira.whamcloud.com/browse/LU-12341</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Modern kernels include memory leak tracing facility called kmemleak.&lt;/p&gt;

&lt;p&gt;It&apos;s controlled by the /sys/kernel/debug/kmemleak file when present (disabled when not).&lt;/p&gt;

&lt;p&gt;Contents show potential memory leaks and while sstem might have their own leaks, if we clear it before Lustre modules load we can then query it before and after modules unload.&lt;/p&gt;

&lt;p&gt;One potential problem with unloaded modules is the backtrace symbol resolution stops working. To combat that we also need to know where the modules were loaded - something we can get from /proc/modules.&lt;/p&gt;

&lt;p&gt;Here&apos;s how to resolve an unknown symbol post module unload having saved /proc/modules output before unload:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;unreferenced object 0xffff8803308e6e00 (size 512):
 comm &quot;mount.lustre&quot;, pid 10718, jiffies 4294871396 (age 55.613s)
 hex dump (first 32 bytes):
   04 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00  ................
   10 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00  ........ .......
 backtrace:
   [&amp;lt;ffffffff81211684&amp;gt;] kmem_cache_alloc_trace+0x134/0x620
   [&amp;lt;ffffffffa0a25584&amp;gt;] 0xffffffffa0a25584
   [&amp;lt;ffffffffa0a572b6&amp;gt;] 0xffffffffa0a572b6
   [&amp;lt;ffffffff8123a690&amp;gt;] mount_bdev+0x1b0/0x1f0
   [&amp;lt;ffffffffa0a4f0d5&amp;gt;] 0xffffffffa0a4f0d5
   [&amp;lt;ffffffff8123aff9&amp;gt;] mount_fs+0x39/0x1b0
   [&amp;lt;ffffffff81258b27&amp;gt;] vfs_kern_mount+0x67/0x110
   [&amp;lt;ffffffffa0af605c&amp;gt;] 0xffffffffa0af605c
   [&amp;lt;ffffffffa0af6c9a&amp;gt;] 0xffffffffa0af6c9a
   [&amp;lt;ffffffffa033f7f3&amp;gt;] 0xffffffffa033f7f3
   [&amp;lt;ffffffffa0340486&amp;gt;] 0xffffffffa0340486
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;we&apos;ll look towards the 1st unknown item in the trace as the demo here: 0xffffffffa0a25584&lt;/p&gt;

&lt;p&gt;It seems to be matching this like in saved modules output for the address range:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;ldiskfs 636444 1 osd_ldiskfs, Live 0xffffffffa0a1d000
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So now to resolve the symbol we will use gdb:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[root@centos6-16 tests]# gdb
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-redhat-linux-gnu&quot;.
For bug reporting instructions, please see:
&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.
(gdb) add-symbol-file ../../ldiskfs/ldiskfs.o 0xffffffffa0a1d000
add symbol table from file &quot;../../ldiskfs/ldiskfs.o&quot; at
	.text_addr = 0xa0a1d000
(y or n) y
Reading symbols from /home/green/git/lustre-releas1/ldiskfs/ldiskfs.o...done.
(gdb) l *(0xffffffffa0a25584)

0xffffffffa0a25584 is in ldiskfs_mb_init (/home/green/git/lustre-releas1/ldiskfs/mballoc.c:2810).
2805		 */
2806	
2807		/* Allocate table once */
2808		sbi-&amp;gt;s_mb_prealloc_table = kzalloc(
2809			LDISKFS_MAX_PREALLOC_TABLE * sizeof(unsigned long), GFP_NOFS);
2810		if (sbi-&amp;gt;s_mb_prealloc_table == NULL) {
2811			ret = -ENOMEM;
2812			goto out;
2813		}
2814	
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This tells us that the allocation that leaked was that for s_mb_prealloc_table (remember that addresses in backtrace often point to the next instruction after the actual call).&lt;/p&gt;</description>
                <environment></environment>
        <key id="55754">LU-12341</key>
            <summary>Make test-framework aware of kmemleak</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="green">Oleg Drokin</assignee>
                                    <reporter username="green">Oleg Drokin</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 May 2019 18:46:56 +0000</created>
                <updated>Tue, 4 Jun 2019 12:06:56 +0000</updated>
                            <resolved>Tue, 4 Jun 2019 12:06:56 +0000</resolved>
                                    <version>Lustre 2.13.0</version>
                                    <fixVersion>Lustre 2.13.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="248331" author="gerrit" created="Tue, 4 Jun 2019 05:27:13 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/34959/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/34959/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12341&quot; title=&quot;Make test-framework aware of kmemleak&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12341&quot;&gt;&lt;del&gt;LU-12341&lt;/del&gt;&lt;/a&gt; tests: Add kmemleak awareness to test-framework&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 15c0a21ea9a6e98d642e6d16898e46ba9e9b2fa9&lt;/p&gt;</comment>
                            <comment id="248361" author="pjones" created="Tue, 4 Jun 2019 12:06:56 +0000"  >&lt;p&gt;Landed for 21.3&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i00gzr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>