Page MenuHomePhabricator

Crasher in logs in section wrapping
Closed, ResolvedPublic

Description

{"name":"parsoid","hostname":"wtp1025","pid":686,"level":60,"logType":"fatal","wiki":"metawiki","title":"IRC","oldId":17361842,"reqId":"fb4da84c-e021-11e7-9040-210d96a1e08a","userAgent":"Mozilla/5.0 (Linux; Android 5.0.2; ASUS_Z00ED Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Mobile Safari/537.36","msg":"Cannot read property 'unshift' of undefined","stack":"TypeError: Cannot read property 'unshift' of undefined

at /srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/pp/processors/wrapSections.js:270:13
at Array.forEach (native)
at resolveTemplateSectionConflicts (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/pp/processors/wrapSections.js:200:27)
at Object.wrapSections [as proc] (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/pp/processors/wrapSections.js:318:2)
at DOMPostProcessor.doPostProcess (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/DOMPostProcessor.js:513:7)
at emitOne (events.js:96:13)
at TreeBuilder.emit (events.js:188:7)
at TreeBuilder.onEnd (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/HTML5TreeBuilder.js:134:7)
at emitNone (events.js:86:13)
at SyncTokenTransformManager.emit (events.js:185:7)
at SyncTokenTransformManager.onEndEvent (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/TokenTransformManager.js:999:8)
at emitNone (events.js:86:13)
at AsyncTokenTransformManager.emit (events.js:185:7)
at AsyncTokenTransformManager.emitChunk (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/TokenTransformManager.js:371:9)
at TokenAccumulator._callParentCB (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/TokenTransformManager.js:1320:16)
at TokenAccumulator.receiveToksFromChild (/srv/deployment/parsoid/deploy-cache/revs/98139cb09bd1342a50490e7b0b7fb67b13961365/src/lib/wt2html/TokenTransformManager.js:1251:7)","longMsg":"Cannot read property 'unshift' of undefined","levelPath":"fatal","time":"2017-12-13T16:23:42.595Z","v":0}

Event Timeline

ssastry triaged this task as High priority.Dec 13 2017, 4:25 PM

About 250 unique pages in the logs. I think they are related to interaction of extension content and section wrappers when they overlap "badly". The patch handled template-wrapping and section wrappers but not extension. The data-mw structure for the two is a bit different.

This primarily affects pages with <translate> markup that straddle headings and section boundaries.

Change 398077 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] WIP: T182793: Handle extension <-> section boundary conflicts

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

For future reference, the issue is markup like:

<translate>
foo
==bar==
baz
</translate>

This should really be:

<translate>
foo
</translate>
== <translate>bar</translate> ==
<translate>
baz
</translate>

because otherwise the extension boundary straddles a section. Note that even PHP has issues with this: if you use section editing you'll see only the <translate> or the </translate> (depending on what section you fetch), not the complete translation chunk.

Change 398077 merged by jenkins-bot:
[mediawiki/services/parsoid@master] T182793: Handle extension <-> section boundary conflicts

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