Commit 1eb051da authored by git-lg-database.lge.com's avatar git-lg-database.lge.com
Browse files

Fix bugs of sqlite that returns SIGBUS on disk full in WAL mode

Attempts to prepare a query on a WAL database when the disk space is
critically low result in the process killed with SIGBUS.
The crash happens in walIndexWriteHdr invoked from walIndexRecover.

Some Providers that using WAL mode like as SettingsProvider and MediaProvider
get failed in case of disk full with SIGBUS.
This patch changes unixShmMap() to call fallocate() instead of ftruncate.
In case of disk full, fallocate() will return SQLITE_FULL.

This patch is originated from www.sqlite.org.
(URL: http://www.sqlite.org/src/info/5eaa61ea18)
To simplify error status, returned error code is changed
from SQLITE_IOERR_SHMSIZE to SQLITE_FULL.

[written by Yongil Jang <yi.jang@lge.com>]

Change-Id: Idf3cbdab1ed4a4f2bc1b2b93ab6d8900edc7ee05
parent 42c3f418
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment