Closed
Bug 341981
Opened 19 years ago
Closed 19 years ago
sporadic "engine has no properties" error on startup
Categories
(Firefox :: Search, defect)
Tracking
()
VERIFIED
FIXED
Firefox 2 beta1
People
(Reporter: Gavin, Assigned: zeniko)
References
Details
(Keywords: verified1.8.1, Whiteboard: 181b1+)
Attachments
(2 files)
1.22 KB,
patch
|
Gavin
:
review+
darin.moz
:
approval1.8.1+
|
Details | Diff | Splinter Review |
1.41 KB,
patch
|
Gavin
:
review+
mtschrep
:
approval1.8.1+
|
Details | Diff | Splinter Review |
I'm not sure the exact situations in which this happens, I think it has to do with using multiple builds with the same profile, but I've hit it three times in the past day. What ends up happening is that the _buildSortedEngineList pre-allocates an array of a certain size, then fills the engine in order from the storage file. If not all slots are full, then this._engines contains undefined items and iterating through the engine list later in the startup process fails, giving a "engine has no properties" error and a blank search dropdown.
I guess this could have happened when I ran a build including the "use storage" patch, which created the db, and then used an older build that didn't include that patch to install an engine. When the newer build starts up, a new engine exists that doesn't have an entry in the db, which leaves the blank slot in the array.
To fix this, we should make sure that the resultant array from _buildSortedEngineList doesn't contain any undefined items.
Comment 1•19 years ago
|
||
The patch in Bug #340331 has a fix for this.
Reporter | ||
Comment 2•19 years ago
|
||
*** Bug 342122 has been marked as a duplicate of this bug. ***
Comment 3•19 years ago
|
||
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060619 Minefield/3.0a1
Under unknown circumstances Firefox becomes location-sensitive. Only a search in Google works, although all plugins are present, also in the app directory.
Error: uncaught exception: [Exception... "'[JavaScript Error: "engine has no properties" {file: "file:///C:/Docume~1/Ria/Bureau~1/trunk/firefox/components/nsSearchService.js" line: 2118}]' when calling method: [nsIBrowserSearchService::getVisibleEngines]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame :: chrome://browser/content/search/search.xml :: rebuildPopup :: line 256" data: yes]
When I copy the application to another place, suddenly the gray text and the plugins are working again.
Reporter | ||
Comment 4•19 years ago
|
||
If the search component doesn't successfully load the first time you run a build after unzipping it (like when you remove the plugins folder), subsequent startups may also fail because Firefox won't try to reload the search component again. By moving the program folder, you're changing the last-modified date of the .autoreg file, which tells Firefox to try reloading the component at the next startup.
Comment 5•19 years ago
|
||
*** Bug 342168 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 6•19 years ago
|
||
Assignee | ||
Comment 7•19 years ago
|
||
As I see it, this is a regression from bug 335101 which initializes the _sortedEngines array always with length 1 - which causes an undefined engine if there are none.
Reporter | ||
Comment 8•19 years ago
|
||
Comment on attachment 226388 [details] [diff] [review]
respect the fact that _engines is no Array
I don't see how this helps, the array will still have holes if one of the earlier engines in the db sort order no longer exists. I prefer the patch in bug 340331 (just filter the array once we've gone through all db entries).
Attachment #226388 -
Flags: review?(gavin.sharp) → review-
Assignee | ||
Comment 9•19 years ago
|
||
Even if it doesn't fix the general case, that bit of code is still wrong and should be fixed (_engines is an Object and no Array).
Would you prefer a new bug to check this fix in, should I mention the issue over at bug 340331 or will you reconsider fixing it here?
Comment 10•19 years ago
|
||
this should be gone before beta1
Severity: normal → major
Flags: blocking-firefox2?
Target Milestone: --- → Firefox 2 beta1
Reporter | ||
Comment 11•19 years ago
|
||
Comment on attachment 226388 [details] [diff] [review]
respect the fact that _engines is no Array
Ah, you're right, sorry. Yes, we should take both this fix and the filter fix from bug 341986.
Attachment #226388 -
Flags: review-
Attachment #226388 -
Flags: review+
Attachment #226388 -
Flags: approval1.8.1?
Comment 12•19 years ago
|
||
Comment on attachment 226388 [details] [diff] [review]
respect the fact that _engines is no Array
a=darin on behalf of drivers (please land this on the MOZILLA_1_8_BRANCH and add the fixed1.8.1 keyword to this bug)
Attachment #226388 -
Flags: approval1.8.1? → approval1.8.1+
Updated•19 years ago
|
Flags: blocking-firefox2? → blocking-firefox2+
Reporter | ||
Updated•19 years ago
|
Whiteboard: [checkin needed (1.8 branch)]
Reporter | ||
Comment 13•19 years ago
|
||
Checked in on the branch and trunk. I'll leave this open until bug 335102 lands because the problem isn't entirely fixed until then. I can't mark it as depending on bug 335102, though, because Bugzilla sucks (I wish bug 251556 was fixed).
mozilla/browser/components/search/nsSearchService.js 1.1.2.37
mozilla/browser/components/search/nsSearchService.js 1.43
Whiteboard: [checkin needed (1.8 branch)] → [depends on bug 335102]
Comment 14•19 years ago
|
||
I still see the problem that the menus are too large (too many items).
- Delete searchplugins everywhere (remove folders)
- Start Firefox, double-click a word on a page, watch the context-menu
Reporter | ||
Comment 15•19 years ago
|
||
(In reply to comment #14)
> I still see the problem that the menus are too large (too many items).
Can you file another bug on that? It's a separate issue - the context menu code should check for a null currentEngine. It's pretty unlikely to affect any "normal" user, though :).
Comment 16•19 years ago
|
||
(In reply to comment #15)
>
Filed Bug 342643 for this.
Updated•19 years ago
|
Whiteboard: [depends on bug 335102] → [depends on bug 335102] 181b1+
Comment 17•19 years ago
|
||
Adding fixed1.8.1 flag since this patch has been landed on the MOZILLA_1_8_BRANCH per comment #13. I realize that we want bug 335102 to be fixed as well, but that one looks iffy for beta1.
Keywords: fixed1.8.1
Reporter | ||
Comment 18•19 years ago
|
||
I think we should take the one line fix from that patch to fix this issue. This bug sucks, and the fix is easy, so we shouldn't wait for bug 335102 to land to fix this.
Keywords: fixed1.8.1
Comment 19•19 years ago
|
||
Splitting the .filter fix out of my renaming patch, since renaming has been retargeted for beta2.
Attachment #228216 -
Flags: review?(gavin.sharp)
Reporter | ||
Comment 20•19 years ago
|
||
Comment on attachment 228216 [details] [diff] [review]
filter fix
>+ // Filter out any nulls for engines that may have been removed
>+ this._sortedEngines = this._sortedEngines.filter(function(a) { return a; });
I'd kinda prefer "!!a" to make it clear it's the boolean value that matters. Put this right above the "// Array for the remaining engines, alphabetically sorted" comment, too, since this isn't related to the alphaEngines stuff.
Attachment #228216 -
Flags: review?(gavin.sharp) → review+
Comment 21•19 years ago
|
||
Checking in browser/components/search/nsSearchService.js;
/cvsroot/mozilla/browser/components/search/nsSearchService.js,v <-- nsSearchService.js
new revision: 1.49; previous revision: 1.48
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 22•19 years ago
|
||
Comment on attachment 228216 [details] [diff] [review]
filter fix
requesting approval for low-risk high-reward fix, intentionally split off to be acceptable for beta1.
Attachment #228216 -
Flags: approval1.8.1?
Reporter | ||
Updated•19 years ago
|
Whiteboard: [depends on bug 335102] 181b1+ → 181b1+
Reporter | ||
Updated•19 years ago
|
Whiteboard: 181b1+ → [need-a] 181b1+
Updated•19 years ago
|
Attachment #228216 -
Flags: approval1.8.1? → approval1.8.1+
Reporter | ||
Comment 23•19 years ago
|
||
mozilla/browser/components/search/nsSearchService.js 1.1.2.42
Keywords: fixed1.8.1
Whiteboard: [need-a] 181b1+ → 181b1+
Reporter | ||
Updated•19 years ago
|
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•