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

coredump plugin in SoS has a hardcoded limit which prevents collecting coredumps over 200M

Linking RHIVOS CVEs to...Migration: Automation ...RHELPRIO AssignedTeam ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.6, rhel-9.6.z, rhel-9.7
    • sos
    • None
    • No
    • Low
    • rhel-sst-cee-supportability
    • None
    • False
    • False
    • Hide

      None

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

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

      Collect coredump files using SoS plugin that are larger than 200M

      What is the impact of this issue to you?

      Customer requires to collect coredumps of their application using the SoS feature

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

      since RHEL-9.2.0 when the coredump.py plugin was introduced
      package: sos-4.10.0 and later revisions in RHEL 9

      How reproducible is this bug?:

      Always with coredumps larger than 200M

      Steps to reproduce

      1. Create a set  of different coredump sizes 1G, 200M, 400k
      2. dd if=/dev/urandom of=/tmp/random1g bs=1024 count=1048576
      3. dd if=/dev/urandom of=/tmp/random200m bs=1024 count=208000
      4. python -c 'with open("/tmp/random1g", "br") as fp: foo = fp.read(); print("1GiB Read Into Memory"); import os; os.abort()'
      5. python -c 'with open("/tmp/random200m", "br") as fp: foo = fp.read(); print("200M Read Into Memory"); import os; os.abort()'
      6. python -c 'import os; os.abort()'
      7. Run the sos tool with below options:
      8. sos report -vv --all-logs --log-size=0 --only-plugins=coredump --batch

      Expected results

      Collection of all coredump succeeds

      Actual results

      Collection of the coredump that is larger than 200M gets skipped

      [plugin:coredump] Skipping core dump file /var/lib/systemd/coredump/core.python.0.546e2ce70a254227bdca9f19590228ac.6789.1764277047000000.zst due to size

      Additional Information

      The customer tracked the issue to the coredump.py plugin itself, it shows a hardcoded limit 

       86                     # a_c_s does not return any information for a skipped file,
       87                     # so stat the size here and if the core is larger than our
       88                     # limit, move on to the next
       89                     # TODO: do not hardcode this. Extend log-size to per-plugin
       90                     # TODO: option and link this to that value
       91                     if os.stat(core_path).st_size > 209715200:
       92                         self._log_info(
       93                             f"Skipping core dump file {core_path} due to size"
       94                         )
       95                         continue

      In upstream code this may be a regression from being refactored, commit: 99d0ae2
      For our code the plugin was included with this issue.

              rhn-support-jcastillo Jose Castillo
              rhn-support-jgamba Juan Gamba
              Jose Castillo Jose Castillo
              RHEL Supportability QE Bot RHEL Supportability QE Bot
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: