Page MenuHomePhabricator

HTML tidy not executed under HHVM; messes up page layouts
Closed, ResolvedPublic

Description

Steps to reproduce:

  1. Make sure you have HHVM enabled.
  2. Visit any page with incorrectly nested HTML (e.g. [[de:Wikipedia:WikiCon 2015/Umfrage]], if that page gets fixed, just use the sandbox and open some unclosed <div>s)
  3. Purge the page.

Expected result:
Tidy fixes the incorrect nesting/missing closing tags etc.

Actual result:
The page layout is messed up, caused by the missing closing tags.

Note that once the incorrect HTML is saved to cache, it also affects non-HHVM views.


Version: wmf-deployment
Severity: normal

Details

Reference
bz72345

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:55 AM
bzimport set Reference to bz72345.
bzimport added a subscriber: Unknown Object (MLST).

The same issue occurs in a template in fr.wiktionary with HHVM enabled: https://fr.wiktionary.org/w/index.php?title=Mod%C3%A8le:de-nom-f-n&diff=prev&oldid=18645452

Although I can't find an incorrect tag, because the template in question is a bit complicated.

(In reply to darkdadaah from comment #2)

The same issue occurs in a template in fr.wiktionary with HHVM enabled:
https://fr.wiktionary.org/w/index.php?title=Mod%C3%A8le:de-nom-f-
n&diff=prev&oldid=18645452

Although I can't find an incorrect tag, because the template in question is
a bit complicated.

This is caused by Modèle:de-nom-f-n/Documentation: It contains multiple "selfclosing" <div /> tags, but these are invalid in HTML. If you want the documentation to display correctly even when HTML tidy doesn't work, you have to replace them by <div></div> (I won't be able to give an appropriate French summary for such an edit, so I can't fix it).

This also appears to be the cause of bug 72343.

Also, as I noted there, not all servers seem to be affected, and I see a "Tidy was unable to run" HTML comment in the output.

Assuming that $wgTidyInternal is false (by default, this is the case if extension_loaded( 'tidy' ) returns false), it looks like this can only happen if proc_open() or proc_close() fails when called from MWTidy::execExternalTidy().

Michael M.: thanks, the page has been corrected.

I keep here a link to the previous buggy version of the page for future tests (if needed): https://fr.wiktionary.org/w/index.php?title=Mod%C3%A8le:de-nom-f-n/Documentation&oldid=18183655

Also, the html source of the erroneous page contains the message: "Tidy was unable to run". Not that there is any doubt about it now...

  • Bug 72357 has been marked as a duplicate of this bug. ***
  • Bug 72343 has been marked as a duplicate of this bug. ***

Copying my analysis from bug 72357:

This appears to be bug 72205 (or more correctly, the memory leak in HHVM that bug 72205 exacerbates[1]) filling up memory on the HHVM servers, which is eventually causing the attempt to fork Tidy to fail, which is allowing unbalanced tags in certain pages to corrupt the layout.

[1]: https://phabricator.wikimedia.org/T757

This appears to be bug 72205

T74205 is fixed nowadays. Should this task also be closed? (No news for half a year here.) Might also close T74358 which might have same cause?

Aklapper claimed this task.

This appears to be bug 72205

T74205 is fixed nowadays. Should this task also be closed? (No news for half a year here.) Might also close T74358 which might have same cause?

No reply. Assuming that means yes. If not, please reopen and provide a testcase.