Page MenuHomePhabricator

VisualEditor: "Uncaught Error: ve.dm.Document.getNodeFromOffset(): offset 804 is out of bounds" triggered using jquery.IME
Closed, ResolvedPublic1 Estimated Story Points

Description

This bug was found when testing per the sixth and seventh comment at Bug 53708
It seems somewhat heisenbuggy and I haven't been able to reproduce it yet. However, I'm sure of the steps which caused it.
Reporting this so that it's documented in case it is ever seen again.

System Environment:
Windows7 X64 SP1
Google Chrome 29.0.1547.66 m

Test Url:
https://www.mediawiki.org/wiki/Project:Sandbox?veaction=edit

Steps to reproduce:
Enable ULS IME hindi (hi) transliteration (labelled लिप्यंतरण)
Input the following:
agar[SPACE][SPACE][BACKSPACE]

What happens:
Apart from a bunch of buggy behaviour (described in the seventh comment at Bug 53708 ), the following console error shows up once the [BACKSPACE] is pressed:

Uncaught Error: ve.dm.Document.getNodeFromOffset(): offset 804 is out of bounds load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:106
ve.dm.Document.getNodeFromOffset load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:106
ve.dm.Surface.change load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…wPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:84
ve.ce.Surface.onSelectionChange load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:275
oo.EventEmitter.emit load.php?debug=false&lang=hi&modules=ext.visualEditor.base%2Cmediawiki%2Cvi…ck%7Coojs%7Cunicodejs.wordbreak&skin=vector&version=20130919T025548Z&*:139
ve.ce.SurfaceObserver.pollOnceInternal load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:292
ve.ce.SurfaceObserver.pollOnce load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:291
ve.ce.SurfaceObserver.timerLoop load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:290
proxy load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:10

The file urls are:

For the last line:
https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z

For all other lines:
https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperimental%2Cicons-vector%7Cext.visualEditor.viewPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*

Also, the template's formatting was gone with the input hindi text appearing alongside the template text.


Version: unspecified
Severity: normal

Details

Reference
bz54331

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:01 AM
bzimport set Reference to bz54331.

Screenshot showing original error and changed template formatting

I've been able to reproduce this bug in the same system environment on the same test url with the following steps:

Enable ULS hi transliteration
Input a[SPACE][BACKSPACE]a

The error as specified above shows up.

Pressing a space after this brings up the following errors:

Error 1:

Uncaught TypeError: Cannot call method 'insertBefore' of null load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:239
ve.ce.BranchNode.onSplice load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:239
oo.EventEmitter.emit load.php?debug=false&lang=hi&modules=ext.visualEditor.base%2Cmediawiki%2Cvi…ck%7Coojs%7Cunicodejs.wordbreak&skin=vector&version=20130919T025548Z&*:139
ve.dm.BranchNode.splice load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…wPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:44
(anonymous function) load.php?debug=false&lang=hi&modules=ext.visualEditor.base%2Cmediawiki%2Cvi…back%7Coojs%7Cunicodejs.wordbreak&skin=vector&version=20130919T025548Z&*:3
ve.dm.Document.rebuildNodes load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:107
ve.dm.DocumentSynchronizer.synchronizers.rebuild load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:117
ve.dm.DocumentSynchronizer.synchronize load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:119
ve.dm.TransactionProcessor.process load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…wPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:59
ve.dm.Document.commit load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:104
ve.dm.Surface.change load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…wPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:84
ve.ce.Surface.handleInsertion load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:282
ve.ce.Surface.onDocumentKeyPress load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:268
proxy load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:10
ve.EventSequencer.onEvent load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…wPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:19
(anonymous function) load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…wPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:18
jQuery.event.dispatch load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:45
elemData.handle.eventHandle load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:38
6

Error 2:
Uncaught Error: offset 805 out of bounds load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:150
ve.dm.ElementLinearData.getAnnotationIndexesFromOffset load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:150
ve.dm.ElementLinearData.getAnnotationsFromOffset load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:150
ve.ce.Surface.onContentChange load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:277
oo.EventEmitter.emit load.php?debug=false&lang=hi&modules=ext.visualEditor.base%2Cmediawiki%2Cvi…ck%7Coojs%7Cunicodejs.wordbreak&skin=vector&version=20130919T025548Z&*:139
ve.ce.SurfaceObserver.pollOnceInternal load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:292
ve.ce.SurfaceObserver.pollOnce load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:291
ve.ce.Surface.documentOnBlur load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperim…PageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*:264
proxy load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:10
jQuery.event.dispatch load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:45
elemData.handle.eventHandle load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.…l%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z:38

File urls:
https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=false&lang=hi&modules=ext.visualEditor.core%2Cdata%2Cexperimental%2Cicons-vector%7Cext.visualEditor.viewPageTarget.icons-vector%7Crangy&skin=vector&version=20130919T025548Z&*
https://bits.wikimedia.org/www.mediawiki.org/load.php?debug=false&lang=hi&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130912T173512Z

The second error keeps repeating. Also, changing tabs makes the count in the chrome console go up.

It also repeats each time a mouse click is done at the current caret position. It also repeats if the caret is taken to a different position in the text using the mouse or the arrow keys.

Attached:

Related/similar bug: Bug 51526

Editable content in Read mode

Further, after everything stated in Comment 1 has happened, if VE editing is canceled and the js prompt about losing unsaved changes is confirmed, the second error still continues. The tab is set to Read instead of Edit, however the content is still editable and the VE toolbar remains visible (although it doesn't seem to work).

Attached:

After Comment 3, reloading the page by pressing the return key in the address bar gave the following error:

Uncaught RangeError: Maximum call stack size exceeded
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload
proxy
ve.init.mw.ViewPageTarget.onBeforeUnload

Jdforrester-WMF lowered the priority of this task from High to Medium.Jan 9 2015, 10:55 PM

As of https://gerrit.wikimedia.org/r/#/c/264577/ in UniversalLanguageSelector this should now be resolved and working for all users, and will be part of the wmf.12 release starting tomorrow.

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 25 2016, 7:13 PM