The default bug view has changed. See this FAQ.

java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp.getTempDirectory(GeckoApp.java)

RESOLVED FIXED in Firefox 16

Status

()

Firefox for Android
General
--
critical
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Scoobidiver (away), Assigned: rkd)

Tracking

({crash, regression})

16 Branch
Firefox 17
ARM
Android
crash, regression
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox16 fixed)

Details

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

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
There's one crash in 16.0a1/20120712: bp-5350a1f7-14f1-418b-9bdf-7c17c2120713.

java.lang.NullPointerException
	at org.mozilla.gecko.GeckoApp.getTempDirectory(GeckoApp.java:2314)
	at org.mozilla.gecko.GeckoApp.deleteTempFiles(GeckoApp.java:2320)
	at org.mozilla.gecko.GeckoApp.onDestroy(GeckoApp.java:2292)
	at org.mozilla.gecko.BrowserApp.onDestroy(BrowserApp.java:215)
	at android.app.Activity.performDestroy(Activity.java:4629)
	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1082)
	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3111)
	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3142)
	at android.app.ActivityThread.access$1200(ActivityThread.java:127)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1192)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:4507)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
	at dalvik.system.NativeStart.main(Native Method)

More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+org.mozilla.gecko.GeckoApp.getTempDirectory%28GeckoApp.java%29
Looks like this was introduced by bug 769438 and bug 772651:

getExternalFilesDir can return null.
(Assignee)

Updated

5 years ago
Assignee: nobody → blyakher.a
Bug 772888 is also related (caused by getExternalFilesDir returning null) but the patch on there won't fix this, I think, because it's a different call.
(Assignee)

Comment 3

5 years ago
Created attachment 642697 [details] [diff] [review]
fix null pointer exception from accessing getExternalFilesDir

According to the Android ref, getExternalFilesDir returns null if external storage is not currently mounted so it could not ensure the path exists; you will need to call this method again when it is available. This patch checks for nulls and responds appropriately, but it might be better to either retry accessing this directory upon failure (at least once) or to use a different storage directory altogether.
Attachment #642697 - Flags: review?(snorp)
Attachment #642697 - Flags: feedback?(blassey.bugs)
Attachment #642697 - Flags: review?(snorp) → review+
Attachment #642697 - Flags: feedback?(blassey.bugs) → feedback+
(Assignee)

Comment 4

5 years ago
Comment on attachment 642697 [details] [diff] [review]
fix null pointer exception from accessing getExternalFilesDir

Bug caused by (feature/regressing bug #): 769438 and 772651
User impact if declined: Fixed a null-pointer exception that can cause a crash for image sharing
Testing completed (on m-c, etc.): m-c (https://tbpl.mozilla.org/?tree=Try&rev=3a2e534d5539)
Risk to taking this patch (and alternatives if risky): Risk is minimal
String or UUID changes made by this patch: None
Attachment #642697 - Flags: checkin?(blassey.bugs)
Attachment #642697 - Flags: approval-mozilla-aurora?
(Reporter)

Updated

5 years ago
Blocks: 769438, 772651
Keywords: regression
Version: Trunk → Firefox 16
https://hg.mozilla.org/mozilla-central/rev/8f93bcc5bc56
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 17
Attachment #642697 - Flags: checkin?(blassey.bugs)

Comment 6

5 years ago
Comment on attachment 642697 [details] [diff] [review]
fix null pointer exception from accessing getExternalFilesDir

[Triage Comment]
Minimal risk, fixes a low-volume crash regression in 16, and can be backed out if this causes any worse regressions. Approved for Aurora 16.
Attachment #642697 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+

Comment 7

5 years ago
https://hg.mozilla.org/releases/mozilla-aurora/rev/e1ebed628f4b
status-firefox16: --- → fixed
You need to log in before you can comment on or make changes to this bug.