Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-107056

hwloc-gather-topology - grep: warning: stray \ before 0

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-10.0
    • hwloc
    • None
    • No
    • Assignee, Qa Contact, Doc Contact, AssignedTeam, Watchers, Developer
    • None
    • Patch
    • rhel-arch-hw-2
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      What were you trying to do that didn't work?

      hwloc-gather-topology /tmp/topo
      reports this 
       
       directory /sys/devices/virtual/dmi/id/
      directory /sys/kernel/mm/hugepages/
      grep: warning: stray \ before 0
      directory /sys/fs/cgroup/
       
      The problem is with this line in the savemntpnt function:  
       
      if echo "$1" | grep "
      012" ; then

      If I understand it correctly, we want to check if there is a newline character.
      I think we can achieve it with
       
      if [[ $1 == $'\n' ]];
       
      Test:
      text="line1                                    
      line2"
      if [[ $text == $'\n' ]]; then echo "ignore"; fi
      ignore

      text="line1"
      if [[ $text == $'\n' ]]; then echo "ignore"; fi
      => no match
      I have reported the problem and proposed fix to hwloc-users@inria.fr upstream mailing list:

      https://sympa.inria.fr/sympa/arc/hwloc-users/2025-08/msg00000.html

       

      Tested with hwloc-2.11.1-3.el10.x86_64

              rh-ee-kpawlins Krzysztof Pawlinski
              jhladky1@redhat.com Jiri Hladky
              Jakub Cajka Jakub Cajka (Inactive)
              Jeffrey Bastian Jeffrey Bastian
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: