| Summary: | [GTK] Crash when spell checker returns no guesses | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||||
| Component: | WebKitGTK | Assignee: | Michael Catanzaro <mcatanzaro> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | berto, cgarcia, commit-queue, gustavo, mcatanzaro, mrobinson | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | PC | ||||||||
| OS: | Linux | ||||||||
| See Also: |
https://bugzilla.redhat.com/show_bug.cgi?id=1234629 https://bugs.webkit.org/show_bug.cgi?id=146885 |
||||||||
| Attachments: |
|
||||||||
|
Description
Michael Catanzaro
2015-07-09 13:46:49 PDT
Can you confirm this with a recent build? I do not think that WebKitGTK+ uses WebTextCheckerClient.cpp any longer. Created attachment 256517 [details] Backtrace on master (r186333) Created attachment 256522 [details]
Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API Comment on attachment 256522 [details]
Patch
Is it possible to remove the default case here?
(In reply to comment #5) > Comment on attachment 256522 [details] > Patch > > Is it possible to remove the default case here? The WebCore enumeration has about 50 more elements than the WebKitGTK+ enumeration, so to remove the default case, we would have to list those 50 elements above the ASSERT_NOT_REACHED() (to avoid compiler warnings from -Wswitch). So I prefer to keep the default case for this switch; it's really not worth the pain of having to update it whenever a new item is added to the WebCore enumeration. It is possible to remove the default case from the two other switch cases in this file, though. (The advantage of removing the default case is that -Wswitch will warn at build time if a value is missing.) Note: I audited them all to confirm this was the only mistake in the file. (In reply to comment #6) > (In reply to comment #5) > > Comment on attachment 256522 [details] > > Patch > > > > Is it possible to remove the default case here? > > The WebCore enumeration has about 50 more elements than the WebKitGTK+ > enumeration, so to remove the default case, we would have to list those 50 > elements above the ASSERT_NOT_REACHED() (to avoid compiler warnings from > -Wswitch). So I prefer to keep the default case for this switch; it's really > not worth the pain of having to update it whenever a new item is added to > the WebCore enumeration. I wonder if a warning would be better here than an assertion? I guess this only affects debug builds... > I wonder if a warning would be better here than an assertion? I think an assertion is best, to make the issue more noticeable. > I guess this only affects debug builds... In master, yes. Release builds of 2.8 do crash, but this is two separate bugs that just happen to occur in the same situation. Comment on attachment 256522 [details] Patch Clearing flags on attachment: 256522 Committed r186653: <http://trac.webkit.org/changeset/186653> All reviewed patches have been landed. Closing bug. |