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

[c10s] GDB segfaults with some riscv64 kernel modules

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

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • CentOS Stream 10
    • gdb
    • None
    • No
    • None
    • rhel-pt-gdb
    • ssg_platform_tools
    • 1
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • None
    • None
    • Unspecified Release Note Type - Unknown
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64, aarch64
    • None

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

      Generate gdb index data for a riscv64-target cross-compile kernel build from an x86_64 or aarch64 builder system.

      What is the impact of this issue to you?

      This impacts the kernel's build CI, making c10s pipelines fail when trying to build the riscv64 kernel. I have added a temporary workaround that prevents rpmbuild from running gdb at all during affected builds to prevent CI failures for now.

      Please provide the package NVR for which the bug is seen:

      gdb-14.2-4.el10

      gdb-minimal-14.2-4.el10

      How reproducible is this bug?:

      This does not affect every kernel module, but when using an affected ".ko" file I can consistently reproduce this. Occasionally the result is a hang instead of a segfault.

      Steps to reproduce

      $ uname -m
      x86_64
      $ gdb.minimal --version | head -n1
      GNU gdb (CentOS Stream) 14.2-4.el10
      $ gdb.minimal --batch -nx -iex 'set auto-load no' -iex 'set debuginfod enabled off' -ex "file kernel/crypto/lrw.ko" -ex "save gdb-index index_files"
      [...]
      ---------------------
      A fatal error internal to GDB has been detected, further
      debugging is not possible.  GDB will now terminate.This is a bug, please report it.  For instructions, see:
      <https://www.gnu.org/software/gdb/bugs/>.

      This seems to have the same result when using the normal gdb instead of gdb.minimal, or when running on aarch64 instead of x86_64.

      If more affected modules would be helpful, they can be found in the rpmbuild buildroot after a kernel build using an SRPM from this kernel-ark MR. For example:

      $ wget 'https://s3.amazonaws.com/arr-cki-prod-trusted-artifacts/trusted-artifacts/1818705680/build_riscv64/10042264005/artifacts/kernel-6.15.0-0.rc6.51.3863_1818705485.el10.src.rpm'
      $ MAKEFLAGS="-j64" rpmbuild --target riscv64 --with cross --without bpftool --without perf --without tools --without libperf --without selftests -ra kernel-6.15.0*.src.rpm
      $ echo 'gdb.minimal --batch -nx -iex "set debuginfod enabled off" -ex "file $1" >/dev/null 2>&1 || echo "Crashed: $1"' > try_crash
      $ find ~/rpmbuild/BUILDROOT/kernel-*.riscv64/lib/modules/*debug -name '*.ko' -exec bash try_crash {} \;
      try_crash: line 1: 1758677 Segmentation fault      gdb.minimal --batch -nx -iex "set debuginfod enabled off" -ex "file $1" > /dev/null 2>&1
      Crashed: [...]/kernel/crypto/async_tx/async_pq.ko
      Crashed: [...]/kernel/crypto/pcbc.ko
      [...]

      Expected results

      Successful completion

      Actual results

      Segmentation fault

      Other notes

      This issue does not seem to affect the current Fedora 42 version of gdb-minimal (16.2-3.fc42) when installed on top of an otherwise CentOS Stream 10 system.

              keiths@redhat.com Keith Seitz
              rh-ee-jberring Jennifer Berringer
              Keith Seitz Keith Seitz
              Michal Kolar Michal Kolar
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: