Closed
Bug 430058
Opened 17 years ago
Closed 17 years ago
Trying to add certain search plugins from Mycroft causes a crash
Categories
(Camino Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Camino2.0
People
(Reporter: stuart.morgan+bugzilla, Assigned: murph)
Details
(Keywords: crash, fixed1.8.1.15)
Attachments
(1 file, 1 obsolete file)
1.98 KB,
patch
|
stuart.morgan+bugzilla
:
superreview+
|
Details | Diff | Splinter Review |
As reported in bug 410958 comment 6:
1) Go to
http://mycroft.mozdev.org/download.html?name=allmusic&sherlock=&opensearch=yes&submitform=Search
2) Click allmusic - Artist/Group
3) Boom (and not the good Steve Jobs kind)
Flags: camino1.6.1?
Comment 1•17 years ago
|
||
Oops...
Is there a good way of identifying Camino so that I can try and save your users from hitting this?
something similar to the IE7 test:
if ((typeof window.external.AddSearchProvider == "unknown") && meth == "p") {
alert("This plugin uses POST...");
Assignee | ||
Comment 2•17 years ago
|
||
Darn it! Found the problem at least...
The crash occurs in the code added to handle <Param> elements. In cases where a search engine url is not supported, the param handling code attempts to create a NSMutableString from the base search URL, assuming it exists when it is actually nil. I chose instead to check the return value from -[NSMutableString stringWithString:] thinking for some reason that nil arguments were permitted and nil value just returned back; That's obviously not the case, and the nil argument warning is documented.
I'll get a patch in right away.
Assignee: nobody → murph
Comment 3•17 years ago
|
||
Yeah, we definitely need to fix this in 1.6.1.
Sean, are there other similar cases in that area of code that could cause a crash?
Flags: camino1.6.1? → camino1.6.1+
Keywords: crash
Reporter | ||
Comment 4•17 years ago
|
||
Yes, there's also the case where template may not exist, so the condition before trying to interact with it should be changed to:
if ([self browserSupportsSearchQueryURLWithMIMEType:mimeType requestMethod:method] &&
[attributeDict objectForKey:@"template"])
Charles, unfortunately the most reliable way for you to exclude us from POST plug-ins until we fix this (and/or bug 430070 and/or bug 430067) is to look for navigator.vendor = Camino
Assignee | ||
Comment 6•17 years ago
|
||
Sorry for letting this one get in guys.
Thanks for making us aware of the issue Charles, and I also apologize for the resulting inconvience on your site.
On a side note, the crash occurs because of Gecko's vulnerability to Objective-C expressions. They can really cause a mess if allowed to trickle down into Gecko frames, so Core has no choice but to capture them and force a crash by dereferencing a NULL pointer: <http://mxr.mozilla.org/mozilla/source/xpcom/base/nsObjCExceptions.h#57>.
Attachment #316834 -
Flags: review?(stuart.morgan)
Reporter | ||
Comment 7•17 years ago
|
||
(In reply to comment #6)
> On a side note, the crash occurs because of Gecko's vulnerability to
> Objective-C expressions.
Yep, thus bug 430071, which should have been part of my original code. Branch doesn't actually do the catch-and-crash in core; the reason it crashes in 1.6 is that the exception unwinds the whole c++ stack uncleanly and leaves things in a really bad state. The trunk changes make the crash immediate and obvious.
Reporter | ||
Comment 8•17 years ago
|
||
Comment on attachment 316834 [details] [diff] [review]
Fix
>- NSMutableString *searchURL = [NSMutableString stringWithString:[self searchEngineURL]];
>- if (!searchURL)
>+ NSString *baseSearchURL = [self searchEngineURL];
>+ if (!baseSearchURL)
> return;
Rather than having the unneeded local variable, how about just
NSMutableString *searchURL = [[[self searchEngineURL] mutableCopy] autorelease];
Assignee | ||
Comment 9•17 years ago
|
||
(In reply to comment #8)
Yes, much cleaner; Thanks.
Attachment #316834 -
Attachment is obsolete: true
Attachment #316853 -
Flags: review?(stuart.morgan)
Attachment #316834 -
Flags: review?(stuart.morgan)
Reporter | ||
Comment 10•17 years ago
|
||
Comment on attachment 316853 [details] [diff] [review]
Fix
r/sr=smorgan.
Attachment #316853 -
Flags: review?(stuart.morgan) → superreview+
Checked in on the trunk and the MOZILLA_1_8_BRANCH for 1.6.1.
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: fixed1.8.1.15
Resolution: --- → FIXED
Target Milestone: --- → Camino2.0
You need to log in
before you can comment on or make changes to this bug.
Description
•