RESOLVED FIXED 80883
REGRESSION: Spell check tests hit assertions on Mac
https://bugs.webkit.org/show_bug.cgi?id=80883
Summary REGRESSION: Spell check tests hit assertions on Mac
Ryosuke Niwa
Reported 2012-03-12 13:59:27 PDT
The following tests hit assertions on Mac: editing/spelling/spellcheck-queue.html editing/spelling/spellcheck-async-mutation.html editing/spelling/spellcheck-paste.html editing/spelling/grammar-paste.html editing/spelling/spellcheck-sequencenum.html editing/spelling/spellcheck-async.html ASSERTION FAILED: m_processingRequest->sequence() == sequence /Volumes/Data/webkit4/Source/WebCore/editing/SpellChecker.cpp(170) : void WebCore::SpellChecker::didCheck(int, const WTF::Vector<WebCore::TextCheckingResult, 0ul>&) 1 0x1016aac44 WebCore::SpellChecker::didCheck(int, WTF::Vector<WebCore::TextCheckingResult, 0ul> const&) 2 0x100e79863 -[WebEditorSpellCheckResponder perform] 3 0x7fff81172351 __NSFirePerformWithOrder 4 0x7fff836b0b07 __CFRunLoopDoObservers 5 0x7fff8368c434 __CFRunLoopRun 6 0x7fff8368bd8f CFRunLoopRunSpecific 7 0x7fff81181b74 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] 8 0x100014535 runTest(std::string const&) 9 0x100014a56 runTestingServerLoop() 10 0x100014c56 dumpRenderTree(int, char const**) 11 0x100014e64 main 12 0x10000177c start
Attachments
Patch (7.26 KB, patch)
2012-03-12 23:09 PDT, Shinya Kawanaka
no flags
Patch for landing (7.36 KB, patch)
2012-03-12 23:54 PDT, Shinya Kawanaka
no flags
Ryosuke Niwa
Comment 1 2012-03-12 19:46:14 PDT
Shinya Kawanaka
Comment 2 2012-03-12 23:09:37 PDT
Ryosuke Niwa
Comment 3 2012-03-12 23:19:47 PDT
Comment on attachment 131554 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=131554&action=review > Source/WebKit/mac/ChangeLog:9 > + Since WebEditorClient::requestCheckingOfString touches TextCheckingObject in a block statement, > + however it won't be correctly managed in Objective-C. I don't really understand this description. Could you clarify?
Shinya Kawanaka
Comment 4 2012-03-12 23:32:14 PDT
(In reply to comment #3) > (From update of attachment 131554 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=131554&action=review > > > Source/WebKit/mac/ChangeLog:9 > > + Since WebEditorClient::requestCheckingOfString touches TextCheckingObject in a block statement, > > + however it won't be correctly managed in Objective-C. > > I don't really understand this description. Could you clarify? I'm not sure I can describe it well, but let me try. WebEditorClient::requestCheckingOfString uses a closure (for completionHandler), and it uses |request| object in it. |request| will be destroyed when exiting from requestCheckingOfString. However, WebCore::TextCheckingRequest is not an NSObject (or a primitive value), it won't be copied correctly when creating a closure (maybe). So we should not touch |request| in a closure. So I copied necessary fields to stack.
Ryosuke Niwa
Comment 5 2012-03-12 23:45:15 PDT
Comment on attachment 131554 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=131554&action=review >>> Source/WebKit/mac/ChangeLog:9 >>> + however it won't be correctly managed in Objective-C. >> >> I don't really understand this description. Could you clarify? > > I'm not sure I can describe it well, but let me try. > > WebEditorClient::requestCheckingOfString uses a closure (for completionHandler), and it uses |request| object in it. |request| will be destroyed when exiting from requestCheckingOfString. > > However, WebCore::TextCheckingRequest is not an NSObject (or a primitive value), it won't be copied correctly when creating a closure (maybe). So we should not touch |request| in a closure. > > So I copied necessary fields to stack. Ah I see. I think I get what you mean. I'll paraphrase it like something along the line of: The bug was caused by the closure object created in requestCheckingOfString accessing test checking request's member variables even though the request object is not an NSObject and allocated in stack. This resulted in the closure not being able to access those variables when invoked. Fixed the bug by making local copies of those member variables.
Ryosuke Niwa
Comment 6 2012-03-12 23:45:59 PDT
Comment on attachment 131554 [details] Patch r=me provided the description in the change log is revised.
Shinya Kawanaka
Comment 7 2012-03-12 23:49:06 PDT
(In reply to comment #6) > (From update of attachment 131554 [details]) > r=me provided the description in the change log is revised. Thanks, I'll update the ChangeLog.
Shinya Kawanaka
Comment 8 2012-03-12 23:54:15 PDT
Created attachment 131558 [details] Patch for landing
WebKit Review Bot
Comment 9 2012-03-13 01:38:54 PDT
Comment on attachment 131558 [details] Patch for landing Clearing flags on attachment: 131558 Committed r110546: <http://trac.webkit.org/changeset/110546>
WebKit Review Bot
Comment 10 2012-03-13 01:38:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.