Page MenuHomePhabricator

Named refs in an extension introduce empty data-parsoid (null dsr, html id, etc.) which crashes other stuff down the line
Closed, ResolvedPublicBUG REPORT

Description

On the wikitext below, the named ref seems to have an empty dsr that crashed on 51be9c5e1f296e0ce55af639f2fc3cc7953a9409 but currently worked around on master. But, you can reproduce a different crasher by passing the '--dump dom:pre-dsr' or any other dom dumping command.

<poem>foo<ref name="x">''bar''</ref><ref name="x" /></poem>

Details

Request URL
https://th.wikipedia.orghttp//th.wikipedia.org/w/rest.php/th.wikipedia.org/v3/transform/wikitext/to/pagebundle/%E0%B9%80%E0%B8%9E%E0%B8%A5%E0%B8%87%E0%B8%8A%E0%B8%B2%E0%B8%95%E0%B8%B4%E0%B8%AA%E0%B8%B2%E0%B8%98%E0%B8%B2%E0%B8%A3%E0%B8%93%E0%B8%A3%E0%B8%B1%E0%B8%90%E0%B8%AD%E0%B8%B4%E0%B8%AA%E0%B8%A5%E0%B8%B2%E0%B8%A1%E0%B8%AD%E0%B8%B4%E0%B8%AB%E0%B8%A3%E0%B9%88%E0%B8%B2%E0%B8%99
Related Changes in Gerrit:

Event Timeline

ssastry triaged this task as Medium priority.

It's easy enough to ignore nulls in massageLoadedDataParsoid(). I'm just wondering how the nulls got in there in the first place and whether they are my fault.

Maybe ignore the nulls for now and we'll redirect the task to investigating where the nulls came from separately.

Change 730651 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/services/parsoid@master] massageLoadedDataParsoid: Ignore null source ranges

https://gerrit.wikimedia.org/r/730651

ssastry added a subscriber: tstarling.

This wikitext reproduces the problem:

<poem>foo<ref name="x">''bar''</ref></poem>
<poem><ref name="x" /></poem>

The named ref in the second poem is necessary. The null on <i data-parsoid='{"dsr":null}'>bar</i> is present before the fixes, but doesn't crash it, but if I run php bin/parse.php --dump dom:pre-dsr < /tmp/wt, it crashes with other errors probably introduced by whatever is causing the null dsr.

Will retarget the bug report for debugging that.

ssastry renamed this task from RT-testing crashers: type mismatch in massageLoadedDataParsoid to Nested named refs in other extensions introduce empty data-parsoid (null dsr, html id, etc.) which crashes other stuff down the line.Oct 13 2021, 11:38 PM
ssastry removed a subscriber: tstarling.
ssastry renamed this task from Nested named refs in other extensions introduce empty data-parsoid (null dsr, html id, etc.) which crashes other stuff down the line to Named refs in an extension introduce empty data-parsoid (null dsr, html id, etc.) which crashes other stuff down the line.Oct 13 2021, 11:42 PM
ssastry updated the task description. (Show Details)
ssastry removed Phatality ID (Deprecated).
ssastry changed the subtype of this task from "Production Error" to "Bug Report".

Change 730651 merged by jenkins-bot:

[mediawiki/services/parsoid@master] massageLoadedDataParsoid: Ignore null source ranges

https://gerrit.wikimedia.org/r/730651

Change 731792 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.15.0-a4

https://gerrit.wikimedia.org/r/731792

Change 731792 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.15.0-a4

https://gerrit.wikimedia.org/r/731792

ssastry claimed this task.

Turns out the null dsr is legit ... the poem extension explicitly clears it out because it massages wikitext found within and so the computed DSR offsets don't correspond to top-level source and cannot be relied upon.