Bug 2062681

Summary: xml.parsers.expat.ExpatError: out of memory: line 1, column 0
Product: Red Hat Enterprise Linux 8 Reporter: mhou <mhou>
Component: expatAssignee: Tomas Korbar <tkorbar>
Status: CLOSED NOTABUG QA Contact: FrantiĊĦek Hrdina <fhrdina>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.6CC: cstratak, fhrdina, psklenar, tkorbar
Target Milestone: rcKeywords: Regression, TestBlocker
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2062765 (view as bug list) Environment:
Last Closed: 2022-03-16 11:17:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2026666, 2062765    

Description mhou 2022-03-10 10:56:32 UTC
Description of problem:
import xml module and use parsers function got error

Version-Release number of selected component (if applicable):
kernel version: 4.18.0-367.el8.kpq0.x86_64
# rpm -qa | grep python
python3-pip-wheel-9.0.3-22.el8.noarch
python3-linux-procfs-0.7.0-1.el8.noarch
python3-gpg-1.13.1-11.el8.x86_64
python3-chardet-3.0.4-7.el8.noarch
python3-libcomps-0.1.18-1.el8.x86_64
python3-libxml2-2.9.7-13.el8.x86_64
python3-firewall-0.9.3-13.el8.noarch
python3-requests-2.20.0-2.1.el8_1.noarch
platform-python-setuptools-39.2.0-6.el8.noarch
python3-decorator-4.2.1-2.el8.noarch
python3-setuptools-wheel-39.2.0-6.el8.noarch
python3-syspurpose-1.28.28-1.el8.x86_64
python3-pyudev-0.21.0-7.el8.noarch
python3-dbus-1.2.4-15.el8.x86_64
python3-gobject-base-3.28.3-2.el8.x86_64
python3-libdnf-0.63.0-7.el8.x86_64
python3-librepo-1.14.2-1.el8.x86_64
python3-ethtool-0.14-5.el8.x86_64
python3-inotify-0.9.6-13.el8.noarch
python3-dnf-4.7.0-7.el8.noarch
python3-dnf-plugins-core-4.0.21-10.el8.noarch
python3-libselinux-2.9-5.el8.x86_64
python3-slip-dbus-0.6.4-11.el8.noarch
python3-dmidecode-3.12.2-15.el8.x86_64
python3-nftables-0.9.3-25.el8.x86_64
python3-perf-4.18.0-367.el8.kpq0.x86_64
python3-urllib3-1.24.2-5.el8.noarch
python3-cloud-what-1.28.28-1.el8.x86_64
python3-pyyaml-3.12-12.el8.x86_64
platform-python-pip-9.0.3-22.el8.noarch
python3-libs-3.6.8-45.el8.x86_64
platform-python-3.6.8-45.el8.x86_64
python3-six-1.11.0-8.el8.noarch
python3-dateutil-2.6.1-6.el8.noarch
python3-iniparse-0.4-31.el8.noarch
python3-setuptools-39.2.0-6.el8.noarch
python3-pip-9.0.3-22.el8.noarch
python3-unbound-1.7.3-17.el8.x86_64
python36-3.6.8-38.module+el8.5.0+12207+5c5719bc.x86_64
python3-hawkey-0.63.0-7.el8.x86_64
python3-rpm-4.14.3-22.el8.x86_64
python3-idna-2.5-5.el8.noarch
python3-slip-0.6.4-11.el8.noarch
python3-magic-5.33-20.el8.noarch
python3-pysocks-1.6.8-3.el8.noarch
python3-subscription-manager-rhsm-1.28.28-1.el8.x86_64



How reproducible: 100%


Steps to Reproduce:
# python3
Python 3.6.8 (default, Jan 14 2022, 11:04:20) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.parsers import expat
>>> parser = expat.ParserCreate(namespace_separator=':')
>>> parser.Parse('<foo></foo>', True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
xml.parsers.expat.ExpatError: out of memory: line 1, column 0


Actual results:
use parsers function got out of memory

Expected results:
the function can be used as well

Additional info:
upstream issue: https://github.com/libexpat/libexpat/issues/572

Comment 1 Charalampos Stratakis 2022-03-10 13:45:54 UTC
The issue needs to be fixed in the expat package.

Comment 2 mhou 2022-03-10 14:23:10 UTC
I see that tuned tool is also affected by similar issues on rhel8.6 kernel.

tuned-adm profile realtime-virtual-host
^CError: Failed to stop log capture. Restart the TuneD daemon to prevent a memory leak.
Traceback (most recent call last):
  File "/usr/sbin/tuned-adm", line 119, in <module>
    result = admin.action(action_name, **options)
  File "/usr/lib/python3.9/site-packages/tuned/admin/admin.py", line 85, in action
    res = self._controller.run()
  File "/usr/lib/python3.9/site-packages/tuned/admin/dbus_controller.py", line 68, in run
    self._main_loop.run()
  File "/usr/lib/python3.9/site-packages/gi/overrides/GLib.py", line 497, in run
    super(MainLoop, self).run()
  File "/usr/lib64/python3.9/contextlib.py", line 126, in __exit__
    next(self.gen)
  File "/usr/lib64/python3.9/site-packages/gi/_ossighelper.py", line 237, in register_sigint_fallback
    signal.default_int_handler(signal.SIGINT, None)