Closed Bug 1365383 Opened 5 years ago Closed 5 years ago

Crash in <T>::operator() | mozilla::MozPromise<T>::FunctionThenValue<T>::DoResolveOrRejectInternal when trying to init editorspellchecker


(Core :: DOM: Editor, defect)

55 Branch
Not set



Tracking Status
firefox-esr52 --- unaffected
firefox53 --- unaffected
firefox54 --- unaffected
firefox55 + fixed


(Reporter: assafdd, Assigned: m_kato)



(Keywords: crash, regression)

Crash Data


(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36

Steps to reproduce:

1. Open a new tab. 
2. Open developer web console.
3. paste the following script once line after another.

var spellCheckerInput = document.documentElement.appendChild(document.createElementNS("", "input"));
var editor = spellCheckerInput.QueryInterface(Ci.nsIDOMNSEditableElement).editor;
var spellChecker =  Components.classes[";1"].createInstance(Ci.nsIEditorSpellCheck);
spellChecker.InitSpellChecker(editor, false);

The code seem pretty close to the following test:

Actual results:

Firefox crashes 

Expected results:

Spellchecker should be initialized.
I have noticed that the IDL of this service has 3rd optional callback parameter. 
Once i have added it the issues was solved. 
So, I guess it is not optional anymore.
I think it's worth updating the the docs.
Regression range:

Makoto Kato — Bug 1330912 - Part 1. Add async version of SetCurrentDictionary using list. r=Ehsan

Blocks: 1330912
Severity: normal → critical
Crash Signature: [@ <T>::operator() | mozilla::MozPromise<T>::FunctionThenValue<T>::DoResolveOrRejectInternal ]
Has Regression Range: --- → yes
Has STR: --- → yes
Component: Untriaged → Editor
Ever confirmed: true
Flags: needinfo?(m_kato)
Keywords: crash, regression
Product: Firefox → Core
Summary: Firefox 55 crashes when trying to init → Crash in <T>::operator() | mozilla::MozPromise<T>::FunctionThenValue<T>::DoResolveOrRejectInternal when trying to init editorspellchecker
Assignee: nobody → m_kato
Flags: needinfo?(m_kato)
Comment on attachment 8868902 [details]
Bug 1365383 - Spellchecker should consider that callback isn't set.

::: editor/composer/test/test_bug1365383.html:40
(Diff revision 1)
> +  .onSpellCheck(textarea, () => {
> +    // Callback parameter isn't set
> +    spellChecker.UpdateCurrentDictionary();
> +
> +    var canSpellCheck = spellChecker.canSpellCheck();
> +    is(canSpellCheck, true, 'spellCheck is enabled');

Why don't you use ok()?
Attachment #8868902 - Flags: review?(masayuki) → review+
tracking as new crash in 55.
Pushed by
Spellchecker should consider that callback isn't set. r=masayuki
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55

I have a question. How did you find this bug? I mean, why did you try to create an instance of nsIEditorSpellCheck?

I'm working on improving editor's performance, and my patches hit unexpected behavior in an automated test added by this bug's fix. So, if it was just for creating a XUL addon, not allowing to create an instance of nsIEditorSpellCheck from JS, we can get faster editor with simple patch. So, I want to disable it if there is no problem.
Flags: needinfo?(assafdd)
Oh, I realized that a lot of addons creates instances f nsIEditorSpellCheck. So, perhaps, we need to keep supporting it.

But if you don't mind, let me know why did you found this bug. Thanks.
Flags: needinfo?(assafdd)
If I recall correctly, I found it while testing my XUL addon on nightly. 
AFAIK webexentsions do not have spell check API (which is a little sad), so I do not think this issue is to interesting looking forward.
Thank you. Yes, XUL addons are banned by Firefox and this kind of bugs are not valid on Firefox anymore, but not so by Thunderbird. And I'd like to support Tb's XUL addon's unless it'd cause something too bad for Firefox users because editor and spellchecker are mostly touched by them.
You need to log in before you can comment on or make changes to this bug.