Bug 728971

Summary: xml is not valid for specific binary dump
Product: Red Hat Enterprise Linux 6 Reporter: Petr Sklenar <psklenar>
Component: python-dmidecodeAssignee: Petr Oros <poros>
Status: CLOSED NOTABUG QA Contact: Mike Gahagan <mgahagan>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: ovasik, thozza
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-17 12:12:58 UTC Type: ---
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: 1359574, 1366045    

Description Petr Sklenar 2011-08-08 14:17:46 UTC
Description of problem:
xml is not valid for specific binary dump

Version-Release number of selected component (if applicable):
arch specific, only on s390x:
python-dmidecode-3.10.12-1.el6_1.1.s390x
libxml2-2.7.6-1.el6.s390x


How reproducible:
deterministic

Steps to Reproduce:
1, have a dump similar to in bug 583867
2,
# cat test1.py 
import dmidecode

dmidecode.clear_warnings() # Ignore warnings related to no SMBIOS found
dmidecode.set_dev('dmi-From-bug583867-dump')
x = dmidecode.dmidecodeXML()
x.SetResultType(dmidecode.DMIXML_DOC)
x.QuerySection('processor').saveFormatFileEnc('-','UTF-8',1)
3, python test1.py > some.xml
4, xmllint some.xml

some.xml:78: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xB2 0x20 0x29 0x2E
      <Vendor>      .&#65533; ).</Vendor>
-----------------------------------------------------------------------

Actual results:
xml is not valid

Expected results:
xml is utf-8 valid

Additional info:

Comment 4 Petr Sklenar 2011-08-08 14:57:29 UTC
ppc64 has the same issue:

output:78: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xB2 0x20 0x29 0x2E
      <Vendor>      .� ).</Vendor>

Comment 8 Suzanne Logcher 2012-02-14 23:12:37 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 9 Ales Ledvinka 2013-05-13 08:50:36 UTC
(In reply to comment #0)
> dmidecode.set_dev('dmi-From-bug583867-dump')
...
> some.xml:78: parser error : Input is not proper UTF-8, indicate encoding !
> Bytes: 0xB2 0x20 0x29 0x2E
>       <Vendor>      .&#65533; ).</Vendor>
> -----------------------------------------------------------------------

Either it's fixed in python-dmidecode-3.10.13-6.fc18.x86_64 or unable to reproduce.

Comment 10 David Sommerseth 2013-05-13 13:23:26 UTC
(In reply to comment #9)
> (In reply to comment #0)
> > dmidecode.set_dev('dmi-From-bug583867-dump')
> ...
> > some.xml:78: parser error : Input is not proper UTF-8, indicate encoding !
> > Bytes: 0xB2 0x20 0x29 0x2E
> >       <Vendor>      .&#65533; ).</Vendor>
> > -----------------------------------------------------------------------
> 
> Either it's fixed in python-dmidecode-3.10.13-6.fc18.x86_64 or unable to
> reproduce.

I wonder if this is a result of libxml2 being updated.  As python-dmidecode itself doesn't do any encoding at all, it feeds the data to libxml2 which produces the proper XML output in the end.

Some hardware do have corrupt DMI tables.  This is typically common on white-label boxes or prototypes.  And then such odd data may appear.  So it doesn't mean the contents of the field is wrong.  It is just what has been decoded from the DMI tables.  But anyway, python-dmidecode (or libxml2) shouldn't segfault or cause a program to abort in other ways on such data.

Comment 11 Petr Sklenar 2013-05-13 14:35:05 UTC
I try it on s390x and I can see the issue:

# xmllint some.xml
some.xml:78: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xB2 0x20 0x29 0x2E
      <Vendor>      .� ).</Vendor>
                     ^
# rpm -q python-dmidecode
python-dmidecode-3.10.13-1.el6.s390x

Comment 13 Ales Ledvinka 2013-05-13 14:58:31 UTC
(In reply to comment #11)
> I try it on s390x and I can see the issue:

sorry, my misunderstanding. not the dump from s390 but runtime s390.
confirmed reproducible.

Comment 14 RHEL Program Management 2013-10-14 01:01:54 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 17 Petr Oros 2016-10-17 12:12:58 UTC
Closing are based on comment10. There is broken dmitable. Python-dmidecode don't segfaulting, error message "parser error" is from xmllint.