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

RESOLVED FIXED in Firefox 55



2 years ago
11 months ago


(Reporter: assafdd, Assigned: m_kato)


({crash, regression})

55 Branch
crash, regression

Firefox Tracking Flags

(firefox-esr52 unaffected, firefox53 unaffected, firefox54 unaffected, firefox55+ fixed)


(crash signature)


(2 attachments)



2 years ago
Created attachment 8868260 [details]

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.

Comment 1

2 years ago
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.

Comment 2

2 years ago
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
status-firefox53: --- → unaffected
status-firefox54: --- → unaffected
status-firefox55: --- → affected
tracking-firefox55: --- → ?
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


2 years ago
Assignee: nobody → m_kato
Flags: needinfo?(m_kato)
Comment hidden (mozreview-request)

Comment 4

2 years ago
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.
tracking-firefox55: ? → +
Comment hidden (mozreview-request)

Comment 7

2 years ago
Pushed by
Spellchecker should consider that callback isn't set. r=masayuki

Comment 8

2 years ago
Last Resolved: 2 years ago
status-firefox55: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
status-firefox-esr52: --- → unaffected

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)

Comment 11

11 months ago
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.