Last Comment Bug 701835 - Removing a bookmark repeatedly crashes Fennec; java.lang.IllegalArgumentException: Empty values at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1797)
: Removing a bookmark repeatedly crashes Fennec; java.lang.IllegalArgumentExcep...
Status: VERIFIED FIXED
[testday-20111111],[native-crash:P1][...
: crash, reproducible
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: ARM Android
: P3 critical (vote)
: ---
Assigned To: Lucas Rocha (:lucasr)
:
Mentors:
: 701917 (view as bug list)
Depends on: 704490
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-11 13:11 PST by Gabriela [:gaby2300]
Modified: 2016-07-29 14:20 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
11+


Attachments
logcat of crash (37.27 KB, text/plain)
2011-11-11 13:18 PST, Tony Chung [:tchung]
no flags Details
Fix crash when removing bookmarks on Galaxy Tab (1.30 KB, patch)
2011-11-24 10:22 PST, Lucas Rocha (:lucasr)
no flags Details | Diff | Splinter Review
Fix bookmark removal in Honeycomb/ICS (2.62 KB, patch)
2011-12-05 09:41 PST, Lucas Rocha (:lucasr)
no flags Details | Diff | Splinter Review
Fix bookmark removal in Honeycomb/ICS (3.19 KB, patch)
2011-12-12 04:45 PST, Lucas Rocha (:lucasr)
blassey.bugs: review+
Details | Diff | Splinter Review

Description Gabriela [:gaby2300] 2011-11-11 13:11:07 PST
Unbookmarking several different sites the android message about the application (Fennec) not working shows up forcing me to close it. I restarted the app several times and each time as I unbookmarked a site the same message showed up
Comment 1 Tony Chung [:tchung] 2011-11-11 13:18:06 PST
Created attachment 573905 [details]
logcat of crash

Attaching logcat.  able to reproduce on Galaxy Tab 10.1.

Repro: on tablet UI, keep bookmarking and unbookmarking a site.  Crash.

In particular, the crash is around RemoveBookmarkTask.doInBackground.

11-11 12:55:38.420: DEBUG/dalvikvm(389): GC_CONCURRENT freed 418K, 10% free 6666K/7367K, paused 3ms+7ms
11-11 12:55:38.420: VERBOSE/AudioPolicyManager(230): releaseOutput() 1
11-11 12:55:38.420: DEBUG/WindowManager(292): addWindowToListInOrder() : current mSkipWidgetFocus='true'
11-11 12:55:38.430: INFO/SurfaceFlinger(227): id=102(7) createSurface 0x13902c for pid 2599 (1x1),1 flag=0, Toast
11-11 12:55:38.430: ERROR/DatabaseUtils(1053): Writing exception to parcel
11-11 12:55:38.430: ERROR/DatabaseUtils(1053): java.lang.IllegalArgumentException: Empty values
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at android.database.sqlite.SQLiteDatabase.updateWithOnConflict(SQLiteDatabase.java:1797)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at android.database.sqlite.SQLiteDatabase.update(SQLiteDatabase.java:1780)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at com.android.browser.provider.BrowserProvider2.updateHistoryInTransaction(BrowserProvider2.java:1642)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at com.android.browser.provider.BrowserProvider2.updateInTransaction(BrowserProvider2.java:1437)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at com.android.browser.provider.SQLiteContentProvider.update(SQLiteContentProvider.java:157)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at android.content.ContentProvider$Transport.update(ContentProvider.java:233)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:208)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at android.os.Binder.execTransact(Binder.java:320)
11-11 12:55:38.430: ERROR/DatabaseUtils(1053):     at dalvik.system.NativeStart.run(Native Method)
11-11 12:55:38.440: WARN/dalvikvm(2599): threadid=15: thread exiting with uncaught exception (group=0x40136760)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599): FATAL EXCEPTION: AsyncTask #2
11-11 12:55:38.440: ERROR/AndroidRuntime(2599): java.lang.RuntimeException: An error occured while executing doInBackground()
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at android.os.AsyncTask$3.done(AsyncTask.java:266)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.lang.Thread.run(Thread.java:1020)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599): Caused by: java.lang.IllegalArgumentException: Empty values
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:166)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at android.content.ContentProviderProxy.update(ContentProviderNative.java:534)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at android.content.ContentResolver.update(ContentResolver.java:847)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at org.mozilla.gecko.Tab$RemoveBookmarkTask.doInBackground(Tab.java:379)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at org.mozilla.gecko.Tab$RemoveBookmarkTask.doInBackground(Tab.java:373)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at android.os.AsyncTask$2.call(AsyncTask.java:252)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
11-11 12:55:38.440: ERROR/AndroidRuntime(2599):     ... 4 more
11-11 12:55:38.460: WARN/ActivityManager(292):   Force finishing activity org.mozilla.fennec_dougt/.App
11-11 12:55:38.470: VERBOSE/WindowOrientationListener(292): rotation : 0   Angle: 356   tilt: 37
11-11 12:55:38.500: ERROR/android.os.Debug(292): Dumpstate > /data/log/dumpstate_app_error
Comment 2 Gabriela [:gaby2300] 2011-11-11 13:22:04 PST
I found this bug using the 20111111 build in my Samsung Galaxy Tab 10.1 and Android 3.1
Comment 3 Gabriela [:gaby2300] 2011-11-11 13:52:35 PST
I found this bug using the 20111111 build, in a Samsung Galaxy Tab 10.1 and Android 3.1
Comment 4 Gabriela [:gaby2300] 2011-11-11 15:23:28 PST
Steps to reproduce:

1) Browse to any site.
2) Tap the bookmark button.
3) The site is not bookmarked.
4) Tap Menu.
5) Tap the bookmark button.
6) The site is bookmarked.
7) Tap the bookmark button.
8) The site is unbookmarked.
9) The android message about the application (Fennec) not working shows up and it forces the user to close the app.

Unbookmarking the site should not cause the above message to appear.
Comment 5 Tony Chung [:tchung] 2011-11-11 16:06:55 PST
I would mark this priority P2 or P3, cause the crash is edge-casey from the STRs.
Comment 6 Tony Chung [:tchung] 2011-11-11 16:07:48 PST
*** Bug 701917 has been marked as a duplicate of this bug. ***
Comment 7 Naoki Hirata :nhirata (please use needinfo instead of cc) 2011-11-21 15:06:26 PST
Setting to end user P1 as it is visible and we have steps to reproduce.
Comment 8 Mark Finkle (:mfinkle) (use needinfo?) 2011-11-21 16:25:53 PST
Note: Does not block the nightly swicthover
Comment 9 Aaron Train [:aaronmt] 2011-11-24 10:11:41 PST
ICS/Honeycomb stack


E/AndroidRuntime( 1297): FATAL EXCEPTION: Thread-16
E/AndroidRuntime( 1297): java.lang.IllegalArgumentException: Empty values
E/AndroidRuntime( 1297): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:166)
E/AndroidRuntime( 1297): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
E/AndroidRuntime( 1297): 	at android.content.ContentProviderProxy.update(ContentProviderNative.java:534)
E/AndroidRuntime( 1297): 	at android.content.ContentResolver.update(ContentResolver.java:847)
E/AndroidRuntime( 1297): 	at org.mozilla.gecko.Tab$RemoveBookmarkTask.doInBackground(Tab.java:395)
E/AndroidRuntime( 1297): 	at org.mozilla.gecko.Tab$RemoveBookmarkTask.doInBackground(Tab.java:389)
E/AndroidRuntime( 1297): 	at org.mozilla.gecko.GeckoAsyncTask$1.run(GeckoAsyncTask.java:47)
E/AndroidRuntime( 1297): 	at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 1297): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 1297): 	at android.os.Looper.loop(Looper.java:132)
E/AndroidRuntime( 1297): 	at org.mozilla.gecko.GeckoAppShell$LooperThread.run(GeckoAppShell.java:147)
Comment 10 Lucas Rocha (:lucasr) 2011-11-24 10:22:59 PST
Created attachment 576797 [details] [diff] [review]
Fix crash when removing bookmarks on Galaxy Tab

Found this bug while doing something else. Gian, I couldn't find you around today so I thought it would be fine to just drop a patch here. It seems there's a bug in Android that somehow considers the "0" string value for BOOKMARK as an empty value.
Comment 11 Lucas Rocha (:lucasr) 2011-11-24 10:50:25 PST
Seems to be caused by changes in the db schema on Honeycomb/ICS. Adding bookmarks is broken as well (see bug 698828). Ignore my patch for now.
Comment 12 Gabriela [:gaby2300] 2011-12-04 15:37:32 PST
I can still reproduce this bug in today's birch build 200111204
Comment 13 Aaron Train [:aaronmt] 2011-12-04 15:39:58 PST
(In reply to Gabriela from comment #12)
> I can still reproduce this bug in today's birch build 200111204

Yes, this is due to a different database schema change in Honeycomb/ICS and the patch submitted in this bug did not land. Bookmarking on your Galaxy Tab will not work.
Comment 14 Lucas Rocha (:lucasr) 2011-12-05 09:41:28 PST
Created attachment 579095 [details] [diff] [review]
Fix bookmark removal in Honeycomb/ICS

Built on top of changes in bug 704490.
Comment 15 Brad Lassey [:blassey] (use needinfo?) 2011-12-09 22:55:36 PST
Comment on attachment 579095 [details] [diff] [review]
Fix bookmark removal in Honeycomb/ICS

Review of attachment 579095 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/db/AndroidBrowserDB.java
@@ +190,5 @@
> +    public void removeBookmarkPost11(ContentResolver cr, String uri) {
> +        cr.delete(Browser.BOOKMARKS_URI,
> +                  Browser.BookmarkColumns.BOOKMARK + " = 1 AND " +
> +                  Browser.BookmarkColumns.URL + " = ?",
> +                  new String[] { uri });

won't this delete it from history? If not, please add a comment
Comment 16 Lucas Rocha (:lucasr) 2011-12-12 04:43:56 PST
(In reply to Brad Lassey [:blassey] from comment #15)
> Comment on attachment 579095 [details] [diff] [review]
> Fix bookmark removal in Honeycomb/ICS
> 
> Review of attachment 579095 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: mobile/android/base/db/AndroidBrowserDB.java
> @@ +190,5 @@
> > +    public void removeBookmarkPost11(ContentResolver cr, String uri) {
> > +        cr.delete(Browser.BOOKMARKS_URI,
> > +                  Browser.BookmarkColumns.BOOKMARK + " = 1 AND " +
> > +                  Browser.BookmarkColumns.URL + " = ?",
> > +                  new String[] { uri });
> 
> won't this delete it from history? If not, please add a comment

Misread Android's source code a bit. Submitting the correct patch now.
Comment 17 Lucas Rocha (:lucasr) 2011-12-12 04:45:31 PST
Created attachment 580877 [details] [diff] [review]
Fix bookmark removal in Honeycomb/ICS

Unfortunately, there's no way to switch the bookmark bit off only using Android < 11 API. We have to tap into the new content provider bits.
Comment 18 Lucas Rocha (:lucasr) 2011-12-13 05:47:49 PST
Pushed: http://hg.mozilla.org/mozilla-central/rev/98037e1999a6
Comment 19 Aaron Train [:aaronmt] 2011-12-13 07:01:32 PST
Samsung Galaxy Tab 10.1 (Android 3.1)
20111213061518
http://hg.mozilla.org/mozilla-central/rev/e79b3396889c

Looking to also verify on ICS.
Comment 20 Gabriela [:gaby2300] 2011-12-13 15:07:53 PST
Samsung Galaxy Tab 10.1 (Android 3.1)
Seems fixed in build 20111213

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