Closed Bug 1236212 Opened 4 years ago Closed 4 years ago

Firefox crashes if date input field has to open with date 2016-01-01

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 46
Tracking Status
firefox43 --- wontfix
firefox44 --- verified
firefox45 --- verified
firefox46 --- fixed
b2g-v2.5 --- fixed
fennec 44+ ---

People

(Reporter: Manuel.Spam, Assigned: Margaret)

References

(Blocks 1 open bug, )

Details

(Keywords: crash, reproducible)

Crash Data

Attachments

(1 file)

I've created a small demonstration page, which crashes Firefox for Android for me.

The page contains a date input field with has both, "max" and "value" set to 2016-01-01.

Tapping this date input field should pop up the date selector, but for me it crashes Firefox.
Confirmed. Crash report ID for mine: bp-422a764e-a041-4149-bf63-e81ad2160102
https://crash-stats.mozilla.com/report/index/422a764e-a041-4249-bf63-e81ad2160102

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at android.widget.NumberPicker.updateInputTextView(NumberPicker.java)


About 300 crashes in the last 7 days.


Java Stack Trace 	

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
	at android.widget.NumberPicker.updateInputTextView(NumberPicker.java:1872)
	at android.widget.NumberPicker.initializeSelectorWheel(NumberPicker.java:1723)
	at android.widget.NumberPicker.onLayout(NumberPicker.java:787)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
	at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1692)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1468)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.widget.ScrollView.onLayout(ScrollView.java:1505)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
	at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
	at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
	at android.view.View.layout(View.java:15689)
	at android.view.ViewGroup.layout(ViewGroup.java:5040)
	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2116)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1873)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1084)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5990)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
	at android.view.Choreographer.doCallbacks(Choreographer.java:580)
	at android.view.Choreographer.doFrame(Choreographer.java:550)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5343)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
tracking-fennec: --- → ?
Crash Signature: [java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at android.widget.NumberPicker.updateInputTextView(NumberPicker.java)]
Keywords: crash, reproducible
Finger points somewhere at widget/DateTimePicker.java.
Assignee: nobody → margaret.leibovic
tracking-fennec: ? → 44+
mantaroh, do you have any ideas what could be going on here? You're more familiar with the date time picker than I am, so any help would be much appreciated!
Flags: needinfo?(mantaroh)
Comment on attachment 8705314 [details]
MozReview Request: Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/29929/diff/1-2/
Flags: needinfo?(mantaroh)
I am still seeing a blank space in the date field with this testcase, but this at least prevents the crash, and it makes this still usable. We can fix that in a follow-up.
Comment on attachment 8705314 [details]
MozReview Request: Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman

https://reviewboard.mozilla.org/r/29929/#review26793

Oh, that's tragic. Also yay footgun APIs.
Attachment #8705314 - Flags: review?(rnewman) → review+
Remember to file that follow-up!
Status: NEW → ASSIGNED
Hardware: ARM → All
Comment on attachment 8705314 [details]
MozReview Request: Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman

Approval Request Comment
[Feature/regressing bug #]: None.

[User impact if declined]: Reproducible crash when using date time picker.

[Describe test coverage new/current, TreeHerder]: No automated tests, tested crash fix locally.

[Risks and why]: Low-risk, fixes off-by-one error to prevent crash.

[String/UUID change made/needed]: None.
Attachment #8705314 - Flags: approval-mozilla-beta?
Attachment #8705314 - Flags: approval-mozilla-aurora?
Blocks: 1237981
https://hg.mozilla.org/integration/fx-team/rev/29b74b9db879bbbd662c38461c10fad3ad22b977
Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman
https://hg.mozilla.org/mozilla-central/rev/29b74b9db879
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 46
Comment on attachment 8705314 [details]
MozReview Request: Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman

Ouch, taking it in aurora.
Attachment #8705314 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Manuel, could you please verify this issue is fixed as expected on a latest Nightly build? Thanks!
Flags: needinfo?(Manuel.Spam)
Comment on attachment 8705314 [details]
MozReview Request: Bug 1236212 - Adjust month number spinner to account for the fact that month is 0-based. r=rnewman

Taking it because it's a one-liner that fixes a crash. Beta44+
Attachment #8705314 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Verified as fixed in Firefox 44  Beta 8;
Device: Asus ZenPad 8 (Android 5.0.2).
(In reply to Ritu Kothari (:ritu) from comment #15)
> Manuel, could you please verify this issue is fixed as expected on a latest
> Nightly build? Thanks!

How to do this? When can I expect this change to arrive in the "Firefox Beta" in the Play store? I'm not able to compile for Android.
Verfied as fixed on Firefox 45 Beta 1
Flags: needinfo?(Manuel.Spam)
(In reply to Manuel Reimer from comment #21)
> (In reply to Ritu Kothari (:ritu) from comment #15)
> > Manuel, could you please verify this issue is fixed as expected on a latest
> > Nightly build? Thanks!
> 
> How to do this? When can I expect this change to arrive in the "Firefox
> Beta" in the Play store? I'm not able to compile for Android.

Hi Manuel, Firefox 49 is currently in Beta cycle and this fix should be in there too. So if you test on Firefox for Android Beta 49, you should be able to verify it.
You need to log in before you can comment on or make changes to this bug.