Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Crash [@ java.lang.NullPointerException: at org.mozilla.gecko.TextSelection$

RESOLVED FIXED in Firefox 16



Firefox for Android
Text Selection
5 years ago
4 years ago


(Reporter: aaronmt, Assigned: Margaret)


({crash, reproducible})

Firefox 17
crash, reproducible

Firefox Tracking Flags

(firefox15 unaffected, firefox16 fixed, firefox17 fixed)


(Whiteboard: [native-crash], crash signature)


(1 attachment, 1 obsolete attachment)



5 years ago
This bug was filed from the Socorro interface and is 
report bp-c1cb660b-da22-4ce4-adb0-b39672120723 .

E/GeckoAppShell( 3801): java.lang.NullPointerException
E/GeckoAppShell( 3801): 	at org.mozilla.gecko.TextSelection$
E/GeckoAppShell( 3801): 	at android.os.Handler.handleCallback(
E/GeckoAppShell( 3801): 	at android.os.Handler.dispatchMessage(
E/GeckoAppShell( 3801): 	at android.os.Looper.loop(
E/GeckoAppShell( 3801): 	at
E/GeckoAppShell( 3801): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/GeckoAppShell( 3801): 	at java.lang.reflect.Method.invoke(
E/GeckoAppShell( 3801): 	at$
E/GeckoAppShell( 3801): 	at
E/GeckoAppShell( 3801): 	at dalvik.system.NativeStart.main(Native Method)
I/WindowState(  307): WIN DEATH: Window{41f28430 SurfaceView paused=false}
I/ActivityManager(  307): Process org.mozilla.fennec:org.mozilla.fennec.WebApp0 (pid 3801) has died.
W/ActivityManager(  307): Force removing ActivityRecord{423a5f90 org.mozilla.fennec/.WebApps$WebApp0}: app died, no saved state
I/WindowState(  307): WIN DEATH: Window{41f16b70 org.mozilla.fennec/org.mozilla.fennec.WebApps$WebApp0 paused=false}


i), and 'Install' a WebApp
ii) Launch WebApp
iii) Create a selection on the far left hand side text; "Logged in users can..."
Samsung Galaxy Nexus (Android 4.1.1)
Nightly (07/23)


5 years ago
Keywords: reproducible

Comment 1

5 years ago
I assume this is because the text selection views aren't included in the gecko layout that web apps use, since this crash means that the handle views are null:

I'd think we just need to add the text selection layout to web_app.xml like:

Comment 2

5 years ago
Created attachment 644977 [details] [diff] [review]

This patch adds the text selection handle layouts to web_app.xml, but I also added a null check in the TextSelection constructor so that we won't crash if we run into this problem again with another GeckoApp instance (text selection just won't work in that case).
Attachment #644977 - Flags: review?(wjohnston)
Comment on attachment 644977 [details] [diff] [review]

Review of attachment 644977 [details] [diff] [review]:

I'd like to move the shared stuff into one layout so that we (hopefully) don't have to keep dealing with this. Clearing review.
Attachment #644977 - Flags: review?(wjohnston)

Comment 4

5 years ago
Created attachment 645046 [details] [diff] [review]
create shared layout

The text_selection_handles layout is now only used in this shared layout. I feel like it's cleaner to keep it separate, but on the other hand it's nicer to minimize the number of XML files we have floating around. What do you think?
Attachment #644977 - Attachment is obsolete: true
Attachment #645046 - Flags: review?(wjohnston)
Comment on attachment 645046 [details] [diff] [review]
create shared layout

Review of attachment 645046 [details] [diff] [review]:

I like!

::: mobile/android/base/resources/layout/shared_ui_components.xml
@@ +1,5 @@
> +<?xml version="1.0" encoding="utf-8"?>
> +<!-- This Source Code Form is subject to the terms of the Mozilla Public
> +   - License, v. 2.0. If a copy of the MPL was not distributed with this
> +   - file, You can obtain one at -->
> +

Lets add a quick comment here explaining what this file is.
Attachment #645046 - Flags: review?(wjohnston) → review+

Comment 6

5 years ago
Target Milestone: --- → Firefox 17

Comment 7

5 years ago
Comment on attachment 645046 [details] [diff] [review]
create shared layout

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 774938 (native handles)
User impact if declined: webapps crash
Testing completed (on m-c, etc.): just landed on inbound
Risk to taking this patch (and alternatives if risky): low-risk inclusion of text selection handle layouts for webapps
String or UUID changes made by this patch: n/a
Attachment #645046 - Flags: approval-mozilla-beta?
Attachment #645046 - Flags: approval-mozilla-aurora?
Comment on attachment 645046 [details] [diff] [review]
create shared layout

approved for beta as part of the dep bugs for native handles for text selection.
Attachment #645046 - Flags: approval-mozilla-beta?
Attachment #645046 - Flags: approval-mozilla-beta+
Attachment #645046 - Flags: approval-mozilla-aurora?
Attachment #645046 - Flags: approval-mozilla-aurora+

Comment 9

5 years ago
Actually, this doesn't need to be on beta because web apps aren't there. I landed it on aurora, though:
status-firefox15: --- → unaffected
status-firefox16: --- → fixed
status-firefox17: affected → fixed
Last Resolved: 5 years ago
Resolution: --- → FIXED
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.