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

dnf crashes in assertion when Sat's libsolv lacks ZST support

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Normal Normal
    • None
    • rhel-8.10
    • libdnf
    • None
    • None
    • Moderate
    • rhel-sst-cs-software-management
    • ssg_core_services
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • None

      This is a continuation of SAT-26026 on the libdnf side of things.

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

      A customer has a local repository with metadata in .zst format installed on a Sat 6.14 system (based on RHEL8.10). Because it's a Sat system, a specific libsolv-0.7.22-4.el8pc package is installed, which doesn't have zstd support inside, hence make solv_xfopen() function return 0.
      This leads to having any dnf command crash in assertion:

      # yum update
      [...]
      platform-python: /builddir/build/BUILD/libdnf-0.63.0/libdnf/dnf-sack.cpp:781: gboolean load_yum_repo(DnfSack*, HyRepo, GError**): Assertion `fp_primary' failed.
      Aborted (core dumped)
      

       
      This assertion occurs because libdnf code assumes that solv_xfopen() never fails, which is just wrong (as seen above, see also analysis in SAT-26026):

       722 static gboolean
       723 load_yum_repo(DnfSack *sack, HyRepo hrepo, GError **error)
       724 {
       :
       780         fp_primary = solv_xfopen(primary.c_str(), "r");
       781         assert(fp_primary);
       :
      

      Please harden this code to properly handle the possible error occurring on line 780.

      Please provide the package NVR for which bug is seen:

      libdnf-0.63.0-19.el8.x86_64

      How reproducible:

      Always

      Steps to reproduce

      1. Setup a local repository with .zst metadata
      2. Install Sat 6.14 specific libsolv-0.7.22-4.el8pc
      3. Perform a yum update command

      Expected results

      Some self-explanatory error message (to be passed by libsolv itself to libdnf)

      Actual results

      Assertion

              amatej@redhat.com Ales Matej
              rhn-support-rmetrich Renaud Métrich
              packaging-team-maint packaging-team-maint
              Software Management QE Software Management QE
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: