<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:49:42 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-12104] SEGV during &quot;lfs find [--mdt-count=[+,-]&lt;count&gt;, --mdt-hash=&lt;hashtype&gt;]&quot;</title>
                <link>https://jira.whamcloud.com/browse/LU-12104</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;As part of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11376&quot; title=&quot;Special file/dir to represent DAOS Containers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11376&quot;&gt;&lt;del&gt;LU-11376&lt;/del&gt;&lt;/a&gt; patchs development and validation, I have found these unexpected errors cases :&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@boro-51 tmp]# lfs df /mnt/testfs
UUID                   1K-blocks        Used   Available Use% Mounted on
testfs-MDT0000_UUID       125368        2084      112048   2% /mnt/testfs[MDT:0]
testfs-MDT0001_UUID       125368        2000      112132   2% /mnt/testfs[MDT:1]
testfs-OST0000_UUID       325368       13648      284560   5% /mnt/testfs[OST:0]
testfs-OST0001_UUID       325368       13652      284556   5% /mnt/testfs[OST:1]

filesystem_summary:       650736       27300      569116   5% /mnt/testfs

[root@boro-51 tmp]# [root@boro-51 tmp]# lfs mkdir --mdt-count=2 --mdt-hash=&quot;fnv_1a_64&quot; /mnt/testfs/foodir
[root@boro-51 tmp]# lfs getdirstripe /mnt/testfs/foodir
lmv_stripe_count: 2 lmv_stripe_offset: 1 lmv_hash_type: fnv_1a_64
mdtidx           FID[seq:oid:ver]
     1           [0x240000400:0x5:0x0]  
     0           [0x200000401:0x5:0x0]  
[root@boro-51 tmp]# [root@boro-51 tmp]# lfs find --mdt-count=+1 --mdt-hash=&quot;fnv_1a_64&quot; /mnt/testfs/*
/mnt/testfs/foodir
[root@boro-51 tmp]# [root@boro-51 tmp]# touch /mnt/testfs/foodir/foo
[root@boro-51 tmp]# lfs find --mdt-count=+1 --mdt-hash=&quot;fnv_1a_64&quot; /mnt/testfs/*
/mnt/testfs/foodir
Segmentation fault (core dumped)
[root@boro-51 tmp]# 
[root@boro-51 tmp]# ls core*
core.146013
[root@boro-51 tmp]# 
[root@boro-51 tmp]# gdb /bin/lfs core.146013
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7_4.1
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;...
Reading symbols from /usr/bin/lfs...Reading symbols from /usr/lib/debug/usr/bin/lfs.debug...done.
done.
[New LWP 146013]
Core was generated by `lfs find --mdt-count=+1 --mdt-hash=fnv_1a_64 /mnt/testfs/foodir /mnt/testfs/msc&apos;.
Program terminated with signal 11, Segmentation fault.
#0  0x00007ffff6f4bd30 in dirfd () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7_4.2.x86_64 libyaml-0.1.4-11.el7_0.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) where
#0  0x00007ffff6f4bd30 in dirfd () from /lib64/libc.so.6
#1  0x00007ffff7bb5404 in cb_get_dirstripe (d=d@entry=0x0, param=param@entry=0x7fffffffd930, path=0x625030 &quot;/mnt/testfs/foodir/foo&quot;) at liblustreapi.c:1745
#2  0x00007ffff7bb9bfd in cb_find_init (path=path@entry=0x625030 &quot;/mnt/testfs/foodir/foo&quot;, parent=&amp;lt;optimized out&amp;gt;, dirp=dirp@entry=0x0, data=data@entry=0x7fffffffd930, de=de@entry=0x628980)
    at liblustreapi.c:4098
#3  0x00007ffff7bb7700 in llapi_semantic_traverse (path=path@entry=0x625030 &quot;/mnt/testfs/foodir/foo&quot;, parent=parent@entry=0x0, sem_init=sem_init@entry=0x7ffff7bb95e0 &amp;lt;cb_find_init&amp;gt;, 
    sem_fini=sem_fini@entry=0x7ffff7bb4d80 &amp;lt;cb_common_fini&amp;gt;, data=data@entry=0x7fffffffd930, de=de@entry=0x0, size=4097) at liblustreapi.c:1938
#4  0x00007ffff7bb7d3d in param_callback (path=&amp;lt;optimized out&amp;gt;, sem_init=sem_init@entry=0x7ffff7bb95e0 &amp;lt;cb_find_init&amp;gt;, sem_fini=sem_fini@entry=0x7ffff7bb4d80 &amp;lt;cb_common_fini&amp;gt;, 
    param=param@entry=0x7fffffffd930) at liblustreapi.c:1986
#5  0x00007ffff7bb9116 in llapi_find (path=&amp;lt;optimized out&amp;gt;, param=param@entry=0x7fffffffd930) at liblustreapi.c:4580
#6  0x0000000000408f1b in lfs_find (argc=5, argv=0x7fffffffe130) at lfs.c:4076
#7  0x00007ffff7bc81d1 in Parser_execarg (argc=argc@entry=5, argv=argv@entry=0x7fffffffe130, cmds=cmds@entry=0x6245c0 &amp;lt;cmdlist&amp;gt;) at util/parser.c:115
#8  0x000000000040422e in main (argc=6, argv=0x7fffffffe128) at lfs.c:9532
(gdb) quit
[root@boro-51 tmp]# 
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Coredump analysis has permitted me to find that this is due to not checking/discarding that/when &quot;DIR *dir&quot; is NULL in cb_find_init() when handling either --mdt-count or --mdt-hash options/filters.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="55237">LU-12104</key>
            <summary>SEGV during &quot;lfs find [--mdt-count=[+,-]&lt;count&gt;, --mdt-hash=&lt;hashtype&gt;]&quot;</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</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="bruno">Bruno Faccini</assignee>
                                    <reporter username="bruno">Bruno Faccini</reporter>
                        <labels>
                    </labels>
                <created>Mon, 25 Mar 2019 12:36:47 +0000</created>
                <updated>Thu, 27 Jun 2019 11:33:47 +0000</updated>
                            <resolved>Thu, 27 Jun 2019 11:32:41 +0000</resolved>
                                                    <fixVersion>Lustre 2.13.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="244624" author="bruno" created="Mon, 25 Mar 2019 12:45:29 +0000"  >&lt;p&gt;Fix/patch for this problem should be something like :&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;diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c
index 67eb90b454..52ccaeb0f7 100644
--- a/lustre/utils/liblustreapi.c
+++ b/lustre/utils/liblustreapi.c
@@ -4096,7 +4304,8 @@ static int cb_find_init(char *path, DIR *parent, DIR **dirp,
                 decision = 0;
 
        if (decision == 0) {
-               if (param-&amp;gt;fp_check_mdt_count || param-&amp;gt;fp_check_hash_type) {
+               if (dir &amp;amp;&amp;amp; (param-&amp;gt;fp_check_mdt_count || 
+                   param-&amp;gt;fp_check_hash_type)) {
                        param-&amp;gt;fp_get_lmv = 1;
                        ret = cb_get_dirstripe(path, dir, param);
                        if (ret != 0)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="244761" author="adilger" created="Wed, 27 Mar 2019 18:14:15 +0000"  >&lt;p&gt;A fix for this is included into patch &lt;a href=&quot;https://review.whamcloud.com/34087&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/34087&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11376&quot; title=&quot;Special file/dir to represent DAOS Containers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11376&quot;&gt;&lt;del&gt;LU-11376&lt;/del&gt;&lt;/a&gt; lmv: new foreign LMV format&lt;/tt&gt;&quot;.&lt;/p&gt;</comment>
                            <comment id="244763" author="bruno" created="Wed, 27 Mar 2019 18:47:25 +0000"  >&lt;p&gt;Yes, you are right Andreas, I forgot to add that in order to be able to check my changes for &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11376&quot; title=&quot;Special file/dir to represent DAOS Containers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11376&quot;&gt;&lt;del&gt;LU-11376&lt;/del&gt;&lt;/a&gt;, I had to integrate the fix already !!...&lt;/p&gt;

&lt;p&gt;So may be I can close this ticket, as change #34087 for &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11376&quot; title=&quot;Special file/dir to represent DAOS Containers&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11376&quot;&gt;&lt;del&gt;LU-11376&lt;/del&gt;&lt;/a&gt; is about to land with the fix in ?&lt;/p&gt;</comment>
                            <comment id="250053" author="bruno" created="Wed, 26 Jun 2019 09:52:21 +0000"  >&lt;p&gt;Not sure to understand why the &quot;Not a Bug&quot; resolution ?&lt;/p&gt;</comment>
                            <comment id="250135" author="adilger" created="Thu, 27 Jun 2019 11:33:47 +0000"  >&lt;p&gt;I guess I thought that the fix was landed before the original patch was landed, but that was incorrect.  I&apos;ve fixed the resolution type.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="53308">LU-11376</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|i00dtb:</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>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>