Nmap Development mailing list archives

Re: zenmap crash in NmapParser.py


From: Daniel Miller <bonsaiviking () gmail com>
Date: Tue, 20 May 2014 21:05:32 -0500

On Fri, May 16, 2014 at 11:53 AM, Jiří Procházka <ojirio () gmail com> wrote:

On Arch Linux, nmap 6.46 with pyxml 0.8.4-10 when finished scanning
services:

Version: 6.46
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/zenmapGUI/ScanInterface.py",
line 597, in verify_execution
    self.load_from_command(scan)
  File "/usr/lib/python2.7/site-packages/zenmapGUI/ScanInterface.py",
line 613, in load_from_command
    parsed.parse_file(command.get_xml_output_filename())
  File "/usr/lib/python2.7/site-packages/zenmapCore/NmapParser.py", line
799, in parse_file
    self.parse(f)
  File "/usr/lib/python2.7/site-packages/zenmapCore/NmapParser.py", line
793, in parse
    self.parser.parse(f)
  File "/usr/lib/python2.7/site-packages/_xmlplus/sax/expatreader.py",
line 109, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/usr/lib/python2.7/site-packages/_xmlplus/sax/xmlreader.py",
line 123, in parse
    self.feed(buffer)
  File "/usr/lib/python2.7/site-packages/_xmlplus/sax/expatreader.py",
line 216, in feed
    self._parser.Parse(data, isFinal)
  File "/usr/lib/python2.7/site-packages/_xmlplus/sax/expatreader.py",
line 312, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/usr/lib/python2.7/site-packages/zenmapCore/NmapParser.py", line
953, in startElement
    self._parse_nmaprun(attrs)
  File "/usr/lib/python2.7/site-packages/zenmapCore/NmapParser.py", line
807, in _parse_nmaprun
    if self._nmap_output is None and "nmap_output" in attrs:
  File "/usr/lib/python2.7/site-packages/_xmlplus/sax/xmlreader.py",
line 316, in __getitem__
    return self._attrs[name]
KeyError: 0


_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Jiří, Chris, and Etienne,

Thank you for your bug reports. This crash is happening because you have
PyXML installed. Python 2's standard library provides XML support through
the xml library [1], but for legacy reasons if it detects PyXML installed,
it will import that instead [2]. The two codebases have diverged, since
PyXML has not been actively developed for over 10 years and has been
abandoned by its maintainers. Crashes of this sort are common with code
that was written for Python 2.4 (as PyXML was).

For now, your best option is to uninstall PyXML. I will continue to
research and see if there is a solution to prevent Python from importing it
if it is present. Your bug reports are appreciated.

Happy scanning,

Dan
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: