Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-12104

SEGV during "lfs find [--mdt-count=[+,-]<count>, --mdt-hash=<hashtype>]"


    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Lustre 2.13.0
    • Labels:
    • Severity:
    • Rank (Obsolete):


      As part of LU-11376 patchs development and validation, I have found these unexpected errors cases :

      [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="fnv_1a_64" /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="fnv_1a_64" /mnt/testfs/*
      [root@boro-51 tmp]# [root@boro-51 tmp]# touch /mnt/testfs/foodir/foo
      [root@boro-51 tmp]# lfs find --mdt-count=+1 --mdt-hash="fnv_1a_64" /mnt/testfs/*
      Segmentation fault (core dumped)
      [root@boro-51 tmp]# 
      [root@boro-51 tmp]# ls core*
      [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 <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
      and "show warranty" for details.
      This GDB was configured as "x86_64-redhat-linux-gnu".
      For bug reporting instructions, please see:
      Reading symbols from /usr/bin/lfs...Reading symbols from /usr/lib/debug/usr/bin/lfs.debug...done.
      [New LWP 146013]
      Core was generated by `lfs find --mdt-count=+1 --mdt-hash=fnv_1a_64 /mnt/testfs/foodir /mnt/testfs/msc'.
      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 "/mnt/testfs/foodir/foo") at liblustreapi.c:1745
      #2  0x00007ffff7bb9bfd in cb_find_init (path=path@entry=0x625030 "/mnt/testfs/foodir/foo", parent=<optimized out>, 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 "/mnt/testfs/foodir/foo", parent=parent@entry=0x0, sem_init=sem_init@entry=0x7ffff7bb95e0 <cb_find_init>, 
          sem_fini=sem_fini@entry=0x7ffff7bb4d80 <cb_common_fini>, data=data@entry=0x7fffffffd930, de=de@entry=0x0, size=4097) at liblustreapi.c:1938
      #4  0x00007ffff7bb7d3d in param_callback (path=<optimized out>, sem_init=sem_init@entry=0x7ffff7bb95e0 <cb_find_init>, sem_fini=sem_fini@entry=0x7ffff7bb4d80 <cb_common_fini>, 
          param=param@entry=0x7fffffffd930) at liblustreapi.c:1986
      #5  0x00007ffff7bb9116 in llapi_find (path=<optimized out>, 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 <cmdlist>) at util/parser.c:115
      #8  0x000000000040422e in main (argc=6, argv=0x7fffffffe128) at lfs.c:9532
      (gdb) quit
      [root@boro-51 tmp]# 

      Coredump analysis has permitted me to find that this is due to not checking/discarding that/when "DIR *dir" is NULL in cb_find_init() when handling either --mdt-count or --mdt-hash options/filters.


          Issue Links



              • Assignee:
                bruno Bruno Faccini
                bruno Bruno Faccini
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: