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

tests: check_mem_leak does not detect LNet memory leaks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

        1. Problem

      On master, `check_mem_leak()` in `test-framework.sh` does not detect an LNet (Portals) memory leak. Tests that unload the modules pass even when LNet leaks memory.

        1. Environment
      • master since LU-18687 "debug: cleanly split lustre_compat and debug" (commit 7fa1ec5446, landed 2026-02-10).
      • Any node. b_es7_0 is not affected.
        1. Reproduction

      1. Make LNet leak memory. The reproducer in LU-21009 is one way.
      2. Unload the modules with `unload_modules_local` or `unload_modules`.
      3. The console shows `(module.c:646:debug_module_exit()) Portals memory leaked: 320 bytes`. `check_mem_leak()` returns 0.

        1. Analysis

      `check_mem_leak()` matches the leak line with this pattern:

      dmesg | tail -n 20 | grep -E -i "libcfs.*memory leaked"
      

      Before LU-18687, `libcfs_exit()` printed the message, so the line contained "libcfs". Now `debug_module_exit()` prints it, and the line does not contain "libcfs". The pattern matches nothing.

      b_es7_0 still prints the message from `libcfs_exit()`, and its `check_mem_leak()` catches the same leak.

        1. Proposed fix

      Match the message text instead of the function name, for example `grep -E "Portals memory leaked"`. This works for the old and the new function name.

            wc-triage WC Triage
            hornc Chris Horn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: