Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-26026

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 6.13.0
    • JPL - Delivery
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 0
    • JPL
    • No

      Description of problem:

      A customer has a local repository with metadata in .zst format. 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)
      

       
      After several days of troubleshooting and reproducing internally, I was able to find out that the Satellite libsolv package, which is not RHEL8 standard library, isn't compiled with zstd support, causing the assertion to fail.
      Assertions should never occur, instead a proper error message should be printed back to the user.
      Culprit code in libsolv:

      657 FILE *
      658 solv_xfopen(const char *fn, const char *mode)
      659 {
       :
      692 #ifdef ENABLE_ZSTD_COMPRESSION
      693   if (suf && !strcmp(suf, ".zst"))
      694     return myzstdfopen(fn, mode);
      695 #else
      696   if (suf && !strcmp(suf, ".zst"))
      697     return 0;
      698 #endif
      

      Here above online 697 (and maybe more lines for similar compression methods), only a return 0 is returned, which leads to assertion failure in dnf code.

      Please fix this by providing human-friendly error messages.

      How reproducible:

      Always 

      Is this issue a regression from an earlier version:

      Don't know.

      Steps to Reproduce:

      1. Setup a local repository with .zst metadata

      2. Perform a yum update command

      Actual behavior:

      Assertion failure

      Expected behavior:

      Error message reported by libsolv, no assertion (requires changes in dnf)

      Business Impact / Additional info:

      Annoyance

              Unassigned Unassigned
              rhn-support-rmetrich Renaud Métrich
              Renaud Métrich
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: