Closed Bug 749493 Opened 12 years ago Closed 12 years ago

Database unlocking code doesn't run due to Java exception in getWritableDatabase()

Categories

(Firefox for Android Graveyard :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(firefox14 fixed, firefox15 fixed, blocking-fennec1.0 beta+)

RESOLVED FIXED
Firefox 15
Tracking Status
firefox14 --- fixed
firefox15 --- fixed
blocking-fennec1.0 --- beta+

People

(Reporter: lucasr, Assigned: lucasr)

References

Details

Attachments

(1 file, 1 obsolete file)

It throws an SQLiteDatabaseLockedException.
Attachment #618906 - Flags: review?(blassey.bugs)
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.
blocking-fennec1.0: --- → ?
Attachment #618906 - Flags: review?(blassey.bugs) → review+
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.
Attachment #618906 - Flags: approval-mozilla-aurora?
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
blocking-fennec1.0: ? → beta+
Attachment #618906 - Attachment is obsolete: true
Attachment #618906 - Flags: approval-mozilla-aurora?
This patch fixes the VerifyError exception.
Attachment #619145 - Flags: review?(blassey.bugs) → review+
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.
Attachment #619145 - Flags: approval-mozilla-aurora?
Attachment #619145 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
First attempt:
http://hg.mozilla.org/mozilla-central/rev/6b5668320ce4 (landing)
http://hg.mozilla.org/mozilla-central/rev/d15db51bf270 (backout)

Second attempt:
http://hg.mozilla.org/mozilla-central/rev/07700c0890b0 (landing)
http://hg.mozilla.org/mozilla-central/rev/1f7740a01fe6 (backout)

Landing f'realz:
http://hg.mozilla.org/mozilla-central/rev/60254db04b75
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 15
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: