Last Comment Bug 749493 - Database unlocking code doesn't run due to Java exception in getWritableDatabase()
: Database unlocking code doesn't run due to Java exception in getWritableDatab...
Status: RESOLVED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: x86 Linux
: -- normal (vote)
: Firefox 15
Assigned To: Lucas Rocha (:lucasr)
:
Mentors:
: 739549 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-26 19:43 PDT by Lucas Rocha (:lucasr)
Modified: 2012-04-30 15:35 PDT (History)
9 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
fixed
beta+


Attachments
Catch SQLiteDatabaseLockedException when ensuring unclocked database (2.60 KB, patch)
2012-04-26 20:01 PDT, Lucas Rocha (:lucasr)
blassey.bugs: review+
Details | Diff | Splinter Review
Catch SQLiteDatabaseLockedException when ensuring unlocked database (2.07 KB, patch)
2012-04-27 12:46 PDT, Lucas Rocha (:lucasr)
blassey.bugs: review+
blassey.bugs: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Lucas Rocha (:lucasr) 2012-04-26 19:43:15 PDT
It throws an SQLiteDatabaseLockedException.
Comment 1 Lucas Rocha (:lucasr) 2012-04-26 20:01:37 PDT
Created attachment 618906 [details] [diff] [review]
Catch SQLiteDatabaseLockedException when ensuring unclocked database
Comment 2 Lucas Rocha (:lucasr) 2012-04-26 20:06:05 PDT
I missed the fact that getWritableDatabase() throws. This patch makes it try to unlock the database file when SQLiteDatabaseLockedException is thrown and tries to open the database again just after. It will throw an (now uncaught) exception if the unlock doesn't really fix the problem. This will allow us to clearly spot the bug if the unlocking doesn't really fix anything.
Comment 3 Lucas Rocha (:lucasr) 2012-04-27 06:15:07 PDT
Pushed: http://hg.mozilla.org/integration/mozilla-inbound/rev/6b5668320ce4
Comment 4 Lucas Rocha (:lucasr) 2012-04-27 06:16:13 PDT
Comment on attachment 618906 [details] [diff] [review]
Catch SQLiteDatabaseLockedException when ensuring unclocked database

Mobile-only. We need this patch in aurora in order to get the db unlocking code to actually run. Right now it will just throw and do nothing if the db happens to be locked.
Comment 5 Ed Morley [:emorley] 2012-04-27 08:02:54 PDT
Landed on inbound as:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6b5668320ce4

Unfortunately had to be backed out for android startup crashes:
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=6b5668320ce4
eg https://tbpl.mozilla.org/php/getParsedLog.php?id=11267342&tree=Mozilla-Inbound

{
PROCESS-CRASH | automation.py | application crashed (minidump found)
Crash dump filename: /tmp/tmpS4Puyx/51b43a10-f778-2a18-55acdc87-3aa74347.dmp
Operating system: Linux
                  0.0.0 Linux 2.6.32.9-00002-gd8084dc-dirty #1 SMP PREEMPT Wed Feb 2 11:32:06 PST 2011 armv7l
CPU: arm
     0 CPUs

Crash reason:  SIGSEGV
Crash address: 0x0

Thread 3 (crashed)
 0  libmozalloc.so!TouchBadMemory [mozalloc_abort.cpp:6b5668320ce4 : 68 + 0x2]
     r4 = 0xafd42550    r5 = 0x4d70ea64    r6 = 0x483bd738    r7 = 0x449dbf60
     r8 = 0x4d70eae8    r9 = 0x449dbf58   r10 = 0x449dbf44    fp = 0x00235578
     sp = 0x4d70ea60    lr = 0x4495d77d    pc = 0x4495d74e
    Found by: given as instruction pointer in context
 1  libmozalloc.so!mozalloc_abort [mozalloc_abort.cpp:6b5668320ce4 : 97 + 0x0]
     r4 = 0xafd42550    r5 = 0x4d70ea64    r6 = 0x483bd738    r7 = 0x449dbf60
     r8 = 0x4d70eae8    r9 = 0x449dbf58   r10 = 0x449dbf44    fp = 0x00235578
     sp = 0x4d70ea60    pc = 0x4495d77d
    Found by: call frame info
 2  libc.so + 0x436ff
     sp = 0x4d70ea7c    pc = 0xafd43700
    Found by: stack scanning
 3  libc.so + 0x4372b
     sp = 0x4d70ea84    pc = 0xafd4372c
    Found by: stack scanning
 4  libdvm.so + 0x16fff
     sp = 0x4d70ea94    pc = 0x80817000
    Found by: stack scanning
 5  libc.so + 0xbe62
     sp = 0x4d70eaa0    pc = 0xafd0be63
    Found by: stack scanning
 6  libdvm.so + 0xa23f3
     sp = 0x4d70eaa8    pc = 0x808a23f4
    Found by: stack scanning
 7  libc.so + 0x4372b
     sp = 0x4d70eaac    pc = 0xafd4372c
    Found by: stack scanning
 8  libmozglue.so!Java_org_mozilla_gecko_GeckoAppShell_reportJavaCrash [APKOpen.cpp:6b5668320ce4 : 331 + 0x6]
     sp = 0x4d70eae0    pc = 0x80c10557
    Found by: stack scanning
 9  libdvm.so + 0x16e37
     r4 = 0x4d70eb08    sp = 0x4d70eae8    pc = 0x80816e38
    Found by: call frame info
10  dalvik-LinearAlloc (deleted) + 0x216f73
     sp = 0x4d70eaf0    pc = 0x432e2f74
    Found by: stack scanning
11  2 (deleted) + 0x37737
     sp = 0x4d70eaf4    pc = 0x483bd738
}

https://hg.mozilla.org/integration/mozilla-inbound/rev/d15db51bf270
Comment 6 Kyle Huey [:khuey] (khuey@mozilla.com) 2012-04-27 12:10:10 PDT
Backed out for blowing up Android.

https://hg.mozilla.org/integration/mozilla-inbound/rev/1f7740a01fe6
Comment 7 Lucas Rocha (:lucasr) 2012-04-27 12:46:30 PDT
Created attachment 619145 [details] [diff] [review]
Catch SQLiteDatabaseLockedException when ensuring unlocked database
Comment 8 Lucas Rocha (:lucasr) 2012-04-27 12:54:57 PDT
This patch fixes the VerifyError exception.
Comment 9 Lucas Rocha (:lucasr) 2012-04-27 13:03:38 PDT
Pushed: http://hg.mozilla.org/integration/mozilla-inbound/rev/60254db04b75
Comment 10 Lucas Rocha (:lucasr) 2012-04-27 13:05:06 PDT
Comment on attachment 619145 [details] [diff] [review]
Catch SQLiteDatabaseLockedException when ensuring unlocked database

Requesting to push to aurora but let's, of course, wait until it lands fine in central.

Mobile-only. We need this patch in aurora in order to get the db unlocking code to actually run. Right now it will just throw and do nothing if the db happens to be locked.
Comment 11 Mark Finkle (:mfinkle) (use needinfo?) 2012-04-28 20:29:08 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/2949b3533041
Comment 13 Mark Finkle (:mfinkle) (use needinfo?) 2012-04-30 11:56:28 PDT
*** Bug 739549 has been marked as a duplicate of this bug. ***

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