Skip to content

Found a bug in version 1.1: "AssertionError: <EMPTY MESSAGE>" caused by html5parser parsing failure. #557

Open
@aT0ngMu

Description

@aT0ngMu

Hi,I Found a bug in version 1.1: "AssertionError: " caused by html5parser parsing failure.The following is the crash stack information:

[1676863707] === Uncaught Python exception: ===
[1676863707] AssertionError: <EMPTY MESSAGE>
[1676863707] Traceback (most recent call last):
[1676863707] File "/home/server1/adashwy/DriverCollections/exp_drivers/pyfuzzgen_drivers/bs4/beautifulsoup_driver/beautifulsoup_driver.py", line 40, in TestOneInput
[1676863707] instance = BeautifulSoup(remaining_data, features=parsers[idx])
[1676863707] File "/home/server1/.local/lib/python3.8/site-packages/bs4/init.py", line 333, in init
[1676863707] self._feed()
[1676863707] File "/home/server1/.local/lib/python3.8/site-packages/bs4/init.py", line 452, in _feed
[1676863707] self.builder.feed(self.markup)
[1676863707] File "/home/server1/.local/lib/python3.8/site-packages/bs4/builder/_html5lib.py", line 99, in feed
[1676863707] doc = parser.parse(markup, **extra_kwargs)
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 284, in parse
[1676863707] self._parse(stream, False, None, *args, **kwargs)
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 133, in _parse
[1676863707] self.mainLoop()
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 242, in mainLoop
[1676863707] new_token = phase.processEndTag(new_token)
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 2534, in processEndTag
[1676863707] new_token = self.parser.phase.processEndTag(token)
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 496, in processEndTag
[1676863707] return func(token)
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 2089, in endTagTable
[1676863707] self.clearStackToTableBodyContext()
[1676863707] File "/usr/local/lib/python3.8/dist-packages/html5lib/html5parser.py", line 2036, in clearStackToTableBodyContext
[1676863707] assert self.parser.innerHTML
[1676863707] AssertionError: <EMPTY MESSAGE>

The following is the testcase that triggers the crash.
testcase.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions