Closed Bug 911604 Opened 11 years ago Closed 11 years ago

Non-default (=manually added) search engines not listed in search settings, can't be set as default

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox26 verified, fennec26+)

VERIFIED FIXED
Firefox 26
Tracking Status
firefox26 --- verified
fennec 26+ ---

People

(Reporter: aryx, Assigned: ckitching)

References

Details

Attachments

(2 files, 2 obsolete files)

Firefox for Android nightly 2013-09-01, Android 4.1.2 (stock), Google Nexus S

The previously added search engines are listed in the awesomebar search, but not in the search settings where the default search engine can be set. So the custom ones can't be made default.
Perhaps there was an issue in migration. Do you have steps to reproduce? Manually added search engines can be set as default in the new search settings just by tapping them and set as default. For example, I just went to Duckduckgo.com and added that search engine and then set it as default in the options.
Status: NEW → UNCONFIRMED
Ever confirmed: false
Attached file logcat
I updated from 2013-08-(something between 07 and 09) to 2013-09-01.

The issue persists after adding Duckduckgo, it is not listed in the search settings after adding it. Looking into the logcat, decodeByteArray() seems to fail, causing a null pointer exception. Related to bug 819895?
Flags: needinfo?(ckitching)
(In reply to Archaeopteryx [:aryx] from comment #2)
> Created attachment 798606 [details]
> logcat
> 
> I updated from 2013-08-(something between 07 and 09) to 2013-09-01.
> 
> The issue persists after adding Duckduckgo, it is not listed in the search
> settings after adding it. Looking into the logcat, decodeByteArray() seems
> to fail, causing a null pointer exception. Related to bug 819895?

Are you using a debug build? If so, this smells like Bug 907917 - for a variety of weird reasons the assertion failure ultimately leads to death by NPE on the Java side.
So far as I can tell, the underlying cause has existed since 23, is an incorrect assertion, and is not obvious.

If you're not using a debug build this is sort of interesting. Perhaps related to some of the madness I've recently encountered in the Favicon system - under certain stupid conditions it might end up storing a null or corrupt Favicon in the database, and then try decoding that, causing the problem. It would be interesting to see the NPE, plus stack trace. It shouldn't be too problematic to add a test for such madness to the search settings thing. It might be preferable to make the caching system less awful (That's being worked on).
Flags: needinfo?(ckitching)
I am not using a debug build, just default mozilla-central nightly branch. After removing the "Gecko" filter in logcat, the only interesting new line I can find is
D/skia    (10749): --- SkImageDecoder::Factory returned null

The favicon of one search engine seems indeed to be corrupted, see https://bug819895.bugzilla.mozilla.org/attachment.cgi?id=690342 and also bug 819895 comment 5.
Blocks: 867371
Status: UNCONFIRMED → NEW
tracking-fennec: --- → ?
Ever confirmed: true
(In reply to Chris Kitching [:ckitching] from comment #3)

> It would be interesting to see the NPE, plus stack trace. It
> shouldn't be too problematic to add a test for such madness to the search
> settings thing. It might be preferable to make the caching system less awful
> (That's being worked on).

From the attached log:

E/GeckoEventDispatcher( 5917): handleGeckoMessage throws java.lang.NullPointerException
E/GeckoEventDispatcher( 5917): java.lang.NullPointerException
E/GeckoEventDispatcher( 5917): 	at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:461)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.preferences.SearchEnginePreference.setSearchEngineFromJSON(SearchEnginePreference.java:108)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.preferences.SearchPreferenceCategory.handleMessage(SearchPreferenceCategory.java:77)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.util.EventDispatcher.dispatchEvent(EventDispatcher.java:96)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.util.EventDispatcher.dispatchEvent(EventDispatcher.java:58)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.GeckoAppShell.handleGeckoMessage(GeckoAppShell.java:2220)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.GeckoAppShell.runGecko(GeckoAppShell.java:337)
E/GeckoEventDispatcher( 5917): 	at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:174)
Assignee: nobody → ckitching
It appears that this is caused by a corrupt/nonexistent Favicon being provided. For now, the simple solution seems to be just add a null check and don't do createScaledBitmap with null.
Once the Favicon caching madness has been demadnessified, I'll revisit this and have it either retry the download or display the default Favicon.

(In reply to :Margaret Leibovic from comment #5)
> From the attached log:
> 
> E/GeckoEventDispatcher( 5917): handleGeckoMessage throws
> java.lang.NullPointerException
> E/GeckoEventDispatcher( 5917): java.lang.NullPointerException
> E/GeckoEventDispatcher( 5917): 	at
> android.graphics.Bitmap.createScaledBitmap(Bitmap.java:461)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.preferences.SearchEnginePreference.
> setSearchEngineFromJSON(SearchEnginePreference.java:108)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.preferences.SearchPreferenceCategory.
> handleMessage(SearchPreferenceCategory.java:77)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.util.EventDispatcher.dispatchEvent(EventDispatcher.java:96)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.util.EventDispatcher.dispatchEvent(EventDispatcher.java:58)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.GeckoAppShell.handleGeckoMessage(GeckoAppShell.java:2220)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.GeckoAppShell.runGecko(GeckoAppShell.java:337)
> E/GeckoEventDispatcher( 5917): 	at
> org.mozilla.gecko.GeckoThread.run(GeckoThread.java:174)

My apologies. It appears I have forgotten how to read.
Attachment #799154 - Flags: review?(margaret.leibovic)
Comment on attachment 799154 [details] [diff] [review]
Add null check before creating scaled bitmap.

This seems like a good workaround. Please also add a comment about why we need to do this null check.
Attachment #799154 - Flags: review?(margaret.leibovic) → review+
...A commit comment would probably also be useful...
Attachment #799161 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/31d86f50d437
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 26
I assume this needs to be uplifted to Fx25, so please request approval.
tracking-fennec: ? → 25+
(In reply to Mark Finkle (:mfinkle) from comment #12)
> I assume this needs to be uplifted to Fx25, so please request approval.

The search settings stuff is only in 26, right?
(In reply to :Margaret Leibovic from comment #13)
> The search settings stuff is only in 26, right?

Correct.
tracking-fennec: 25+ → 26+
Status: RESOLVED → VERIFIED
Flags: in-moztrap?(fennec)
Test case created in moztrap:
https://moztrap.mozilla.org/manage/case/10587/
Flags: in-moztrap?(fennec) → in-moztrap+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: