Last Comment Bug 773943 - java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp.getTempDirectory(GeckoApp.java)
: java.lang.NullPointerException: at org.mozilla.gecko.GeckoApp.getTempDirector...
Status: RESOLVED FIXED
[native-crash]
: crash, regression
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: 16 Branch
: ARM Android
: -- critical (vote)
: Firefox 17
Assigned To: Arkady Blyakher [:rkd]
:
:
Mentors:
Depends on:
Blocks: 769438 772651
  Show dependency treegraph
 
Reported: 2012-07-14 04:06 PDT by Scoobidiver (away)
Modified: 2012-07-24 10:31 PDT (History)
6 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
fix null pointer exception from accessing getExternalFilesDir (4.26 KB, patch)
2012-07-16 13:23 PDT, Arkady Blyakher [:rkd]
snorp: review+
blassey.bugs: feedback+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Scoobidiver (away) 2012-07-14 04:06:14 PDT
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
Comment 1 Geoff Brown [:gbrown] 2012-07-16 10:35:47 PDT
Looks like this was introduced by bug 769438 and bug 772651:

getExternalFilesDir can return null.
Comment 2 Kartikaya Gupta (email:kats@mozilla.com) 2012-07-16 12:36:34 PDT
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.
Comment 3 Arkady Blyakher [:rkd] 2012-07-16 13:23:25 PDT
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.
Comment 4 Arkady Blyakher [:rkd] 2012-07-17 10:11:23 PDT
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
Comment 5 Ryan VanderMeulen [:RyanVM] 2012-07-20 21:04:07 PDT
https://hg.mozilla.org/mozilla-central/rev/8f93bcc5bc56
Comment 6 Alex Keybl [:akeybl] 2012-07-23 10:24:31 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.