Closed
Bug 776223
Opened 13 years ago
Closed 12 years ago
java.lang.NullPointerException: at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java) on Samsung devices running ICS
Categories
(Firefox for Android Graveyard :: Keyboards and IME, defect)
Tracking
(firefox16 affected, firefox17 affected, firefox18 affected, firefox19 affected, firefox20 affected, firefox21 wontfix, firefox22+ fixed, firefox23 fixed, firefox24 fixed)
People
(Reporter: scoobidiver, Assigned: cpeterson)
References
Details
(Keywords: crash, Whiteboard: [native-crash])
Crash Data
Attachments
(2 files)
|
2.37 KB,
patch
|
blassey
:
review+
akeybl
:
approval-mozilla-aurora+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
|
1.79 KB,
patch
|
blassey
:
review+
akeybl
:
approval-mozilla-aurora+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
There are 11 crashes in 14.0 and 15.0 Beta. Here is a crash report: bp-9ad34ba8-3e8e-4865-911c-926eb2120719.
java.lang.NullPointerException
at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:137)
at org.mozilla.gecko.GeckoAppShell$7.run(GeckoAppShell.java:1065)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at org.mozilla.gecko.GeckoBackgroundThread.run(GeckoBackgroundThread.java:31)
More reports at:
https://crash-stats.mozilla.com/report/list?signature=java.lang.NullPointerException%3A+at+android.content.ClipboardManager.setPrimaryClip%28ClipboardManager.java%29
| Assignee | ||
Comment 1•13 years ago
|
||
This code is running on the GeckoBackgroundThread. I suspect the ClipboardManager probably wants to be called on the UI thread because nothing in GeckoAppShell.setClipboardText() looks like to could cause a NullPointerExceptionin ClipboardManager.setPrimaryClip().
https://hg.mozilla.org/releases/mozilla-aurora/annotate/e070197f4c89/mobile/android/base/GeckoAppShell.java#l1289
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/content/ClipboardManager.java#L119
| Reporter | ||
Updated•13 years ago
|
| Reporter | ||
Updated•13 years ago
|
status-firefox19:
--- → affected
Version: Firefox 14 → Trunk
| Reporter | ||
Updated•12 years ago
|
status-firefox20:
--- → affected
status-firefox21:
--- → affected
| Reporter | ||
Updated•12 years ago
|
status-firefox22:
--- → affected
| Reporter | ||
Updated•12 years ago
|
status-firefox23:
--- → affected
| Assignee | ||
Comment 2•12 years ago
|
||
I believe this problem will be fixed by bug 870333.
Status: NEW → RESOLVED
Closed: 12 years ago
status-firefox24:
--- → fixed
Component: General → Keyboards and IME
Depends on: 870333
Resolution: --- → WORKSFORME
| Reporter | ||
Updated•12 years ago
|
Resolution: WORKSFORME → FIXED
Target Milestone: --- → Firefox 24
| Reporter | ||
Comment 3•12 years ago
|
||
(In reply to Chris Peterson (:cpeterson) from comment #2)
> I believe this problem will be fixed by bug 870333.
No. See bp-2a2c8059-0f05-47fa-8e9e-96b952130517.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: Firefox 24 → ---
| Assignee | ||
Comment 4•12 years ago
|
||
Paste an empty string instead of null to avoid clipboard crashes. AndroidBridge::EmptyClipboard() passes null to clear the clipboard's current contents.
Assignee: nobody → cpeterson
Status: REOPENED → ASSIGNED
Attachment #751270 -
Flags: review?(blassey.bugs)
| Reporter | ||
Comment 5•12 years ago
|
||
It's #38 crasher in 21.0 and #6 in 22.0b1 (many duplicates).
Updated•12 years ago
|
Attachment #751270 -
Flags: review?(blassey.bugs) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
| Assignee | ||
Comment 7•12 years ago
|
||
Scoobidiver, thanks for reopening this bug so I could find the real fix! <:)
After my fix is merged to mozilla-central, I will ask to uplift the fix to Aurora 23 and Beta 22.
Comment 8•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 24
| Assignee | ||
Comment 9•12 years ago
|
||
Comment on attachment 751270 [details] [diff] [review]
dont-paste-null.patch
[Approval Request Comment]
Bug caused by (feature/regressing bug #):
User impact if declined: Long-standing topcrash will persist. Scoobidiver says this crash is #38 in 21.0 and #6 in 22.0b1 (with many duplicates).
Testing completed (on m-c, etc.): m-c
Risk to taking this patch (and alternatives if risky): Low risk because it is basically just adding a null check.
String or IDL/UUID changes made by this patch: N/A
Attachment #751270 -
Flags: approval-mozilla-beta?
Attachment #751270 -
Flags: approval-mozilla-aurora?
Updated•12 years ago
|
tracking-firefox22:
--- → +
Updated•12 years ago
|
Attachment #751270 -
Flags: approval-mozilla-beta?
Attachment #751270 -
Flags: approval-mozilla-beta+
Attachment #751270 -
Flags: approval-mozilla-aurora?
Attachment #751270 -
Flags: approval-mozilla-aurora+
| Assignee | ||
Comment 10•12 years ago
|
||
| Reporter | ||
Comment 11•12 years ago
|
||
It's not fixed.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 12•12 years ago
|
||
Thanks again for your diligence, Scoobidiver! <:)
I am now convinced this crash is a Samsung bug. Of the 1,252 ClipboardManager crash reports in Firefox 21, 22b1, 23a2, and 24a1 over the past 28 days, 100% of these crashes are from Samsung devices!!
According to similar reports on Samsung developer forums [1] and Google's Android issue tracker [2], the workaround is to root your phone and delete the files in /data/clipboard.
> Samsung devices running TouchWiz and Android 3.0 or higher have a fatal
> clipboard bug that can cause it to become permanently unusable until a
> factory reset. It seems to occur randomly. Whenever a user tries to copy
> something, this error occurs in the system ClipboardManager class:
>
> java.lang.NullPointerException at
> android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java:146)
>
> And the application that the user is using crashes. The only fix for this
> is to perform a factory reset or to clear the contents of /data/clipboard
> as a rooted user. Since this directory does not exist in stock Android,
> the fault is clearly with the Samsung software.
[1] http://developer.samsung.com/forum/board/thread/view.do?boardName=GeneralB&messageId=221255
[2] https://code.google.com/p/android/issues/detail?id=35732
| Reporter | ||
Updated•12 years ago
|
Summary: java.lang.NullPointerException: at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java) → java.lang.NullPointerException: at android.content.ClipboardManager.setPrimaryClip(ClipboardManager.java) on Samsung devices running ICS
| Assignee | ||
Comment 13•12 years ago
|
||
| Assignee | ||
Comment 14•12 years ago
|
||
Comment on attachment 754932 [details] [diff] [review]
Catch NullPointerException from Samsung's buggy clipboard API. r=
This topcrash is actually a Samsung bug. 100% of all these 1,200+ clipboard crashes across all channels over the past 28 days are on Samsung devices!
Samsung's clipboard implementation tries to cache clipboard items in /data/clipboard, but their code will throw a NullPointerException if this directory is full. Should we limit this NullPointerException catch to Samsung devices?
Attachment #754932 -
Flags: review?(blassey.bugs)
Comment 15•12 years ago
|
||
Comment on attachment 754932 [details] [diff] [review]
Catch NullPointerException from Samsung's buggy clipboard API. r=
Review of attachment 754932 [details] [diff] [review]:
-----------------------------------------------------------------
No, no need to limit this try/catch to only Samsung devices. Is it possible to clear that cache though?
Attachment #754932 -
Flags: review?(blassey.bugs) → review+
| Assignee | ||
Comment 16•12 years ago
|
||
(In reply to Brad Lassey [:blassey] from comment #15)
> Is it possible to clear that cache though?
Unfortunately, no. According to the discussion on the Samsung forums and Android's bug tracker, you must root the phone to delete the files in (the Samsung-specific directory) /data/clipboard.
| Assignee | ||
Comment 17•12 years ago
|
||
Comment 18•12 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 19•12 years ago
|
||
Comment on attachment 754932 [details] [diff] [review]
Catch NullPointerException from Samsung's buggy clipboard API. r=
[Approval Request Comment]
Bug caused by (feature/regressing bug #): This is a Samsung bug. 100% of this bug's 1,200+ crashes are on Samsung devices, confirmed on Samsung's developer forum.
User impact if declined: Long-standing crash on Samsung devices.
Testing completed (on m-c, etc.): Speculative fix; I have not reproduced the bug myself.
Risk to taking this patch (and alternatives if risky): Low risk. The patch just catches a NullPointerException intermittently thrown from Samsung's clipboard API.
String or IDL/UUID changes made by this patch: N/A
Attachment #754932 -
Flags: approval-mozilla-beta?
Attachment #754932 -
Flags: approval-mozilla-aurora?
Comment 20•12 years ago
|
||
Comment on attachment 754932 [details] [diff] [review]
Catch NullPointerException from Samsung's buggy clipboard API. r=
Approving this speculative fix given where we are in the cycle and the low risk nature of a null check.
Attachment #754932 -
Flags: approval-mozilla-beta?
Attachment #754932 -
Flags: approval-mozilla-beta+
Attachment #754932 -
Flags: approval-mozilla-aurora?
Attachment #754932 -
Flags: approval-mozilla-aurora+
| Assignee | ||
Comment 21•12 years ago
|
||
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•