Bug 2062765

Summary: xml.parsers.expat.ExpatError: out of memory: line 1, column 0
Product: Red Hat Enterprise Linux 9 Reporter: mhou <mhou>
Component: expatAssignee: Tomas Korbar <tkorbar>
Status: CLOSED NOTABUG QA Contact: FrantiĊĦek Hrdina <fhrdina>
Severity: high Docs Contact:
Priority: unspecified    
Version: 9.0CC: cstratak, fhrdina, psklenar, rhel-cs-infra-services-qe, 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: 2062681 Environment:
Last Closed: 2022-03-16 11:16:34 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: 2062681    
Bug Blocks: 2027125    

Description mhou 2022-03-10 14:31:53 UTC
+++ This bug was initially created as a clone of Bug #2062681 +++

Description of problem:
import xml module and use parsers function got error

Version-Release number of selected component (if applicable):
kernel version: 5.14.0-70.rt21.70.el9.x86_64
# rpm -qa | grep python
python3-setuptools-wheel-53.0.0-10.el9.noarch
python3-pip-wheel-21.2.3-6.el9.noarch
python-unversioned-command-3.9.10-2.el9.noarch
python3-3.9.10-2.el9.x86_64
python3-libs-3.9.10-2.el9.x86_64
python3-dbus-1.2.18-2.el9.x86_64
python3-six-1.15.0-9.el9.noarch
python3-dateutil-2.8.1-6.el9.noarch
python3-iniparse-0.4-45.el9.noarch
python3-gobject-base-3.40.1-5.el9.x86_64
python3-idna-2.10-7.el9.noarch
python3-setuptools-53.0.0-10.el9.noarch
python3-inotify-0.9.6-25.el9.noarch
python3-libcomps-0.1.18-1.el9.x86_64
libcap-ng-python3-0.8.2-7.el9.x86_64
python3-chardet-4.0.0-5.el9.noarch
python3-decorator-4.4.2-6.el9.noarch
python3-ethtool-0.15-2.el9.x86_64
python3-libxml2-2.9.13-1.el9.x86_64
python3-dmidecode-3.12.2-27.el9.x86_64
python3-nftables-0.9.8-12.el9.x86_64
python3-firewall-1.0.0-4.el9.noarch
python3-pysocks-1.7.1-12.el9.noarch
python3-urllib3-1.26.5-3.el9.noarch
python3-requests-2.25.1-6.el9.noarch
python3-cloud-what-1.29.26-1.el9.x86_64
python3-gpg-1.15.1-6.el9.x86_64
python3-librepo-1.14.2-1.el9.x86_64
python3-libdnf-0.65.0-3.el9.x86_64
python3-hawkey-0.65.0-3.el9.x86_64
python3-rpm-4.16.1.3-11.el9.x86_64
python3-dnf-4.10.0-4.el9.noarch
python3-dnf-plugins-core-4.0.24-3.el9.noarch
python3-subscription-manager-rhsm-1.29.26-1.el9.x86_64
python3-libselinux-3.3-2.el9.x86_64
python3-pyyaml-5.4.1-6.el9.x86_64
python3-lxml-4.6.5-2.el9.x86_64
python3-pycurl-7.43.0.6-8.el9.x86_64
python3-koji-1.23.0-2.fc33.noarch
python3-linux-procfs-0.7.0-1.el9.noarch
python3-pyudev-0.22.0-6.el9.noarch
python3-pyparsing-2.4.7-9.el9.noarch
python3-ptyprocess-0.6.0-12.el9.noarch
python3-pexpect-4.8.0-7.el9.noarch
python3-perf-5.14.0-70.el9.x86_64
python-srpm-macros-3.9-52.el9.noarch
python3-setools-4.4.0-4.el9.x86_64
python3-libsemanage-3.3-2.el9.x86_64
python3-audit-3.0.7-101.el9.x86_64
python3-policycoreutils-3.3-5.el9.noarch
policycoreutils-python-utils-3.3-5.el9.noarch
python3-libvirt-8.0.0-1.el9.x86_64
python3-argcomplete-1.12.0-5.el9.noarch
python3-pyelftools-0.27-4.el9.noarch




How reproducible: 100%


Steps to Reproduce:
# python3
Python 3.9.10 (main, Feb  9 2022, 00:00:00) 
[GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] 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
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit



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