SQLite Forum

Timeline
Login

10 forum posts by user liziqi

2021-10-14
03:18 Reply: SIGBUS in sqlite (artifact: cf32387473 user: liziqi)
Hi WaterWu:
  Has the problem been solved ? What is the reason ?
2021-09-26
07:05 Reply: SIGBUS in sqlite (artifact: b484895ced user: liziqi)
Yes, still use this room.
In our actual scenario, this situation has only occurred once. Under normal circumstances, this happens only if the index file is illegally truncated. So we have checked the code. There is a way of directly deleting the db, wal, shm files in our code, followed by the reconstruction process, so it is suspected to be introduced in this place, but there is no direct evidence. The problem is suspended because it rarely occur.
2021-09-24
02:07 Reply: launch backup_malloc.test error (artifact: 13ca6860c8 user: liziqi)
Which testcase do you execute ? backup_malloc.test or mallocAll.test ? If only execute backup_malloc.test, it wolud be ok because it doesn't check that fd is closed. 

If not encounter OOM situations in the backup_malloc.test, the testcase also is ok, But the fd is not closed, it would affect the result of other testcases, such as malloc.test malloc-1.X etc. if so, the relation of tesecases exists coupling. This scenario is also right ?
2021-09-23
09:20 Post: launch backup_malloc.test error (artifact: c76e703b12 user: liziqi)
Hi all. We're currently on SQLite 3.32.2, and we've been noticed that testcase mallocAll.test would fail because of backup_malloc.test doesn't close db.

backup_malloc.test did not close all files: 1

In the latest version of backup_malloc.test, the problem still exist. So is it correct that close db and db2 when finalize the backup. 

origin testcase backup_malloc.test : 

do_faultsim_test 3 -faults oom* -prep {
  catch { db close }
  catch { db2 close }

  forcedelete test2.db
  sqlite3 db2 test2.db
  sqlite3 db test.db
  sqlite3_backup B db2 main db main
} -body {

  set rc [B step 50]
  if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} {
    error "out of memory"
  }

} -test {
  faultsim_test_result {0 {}} 
  faultsim_integrity_check
  
  # Finalize the backup.
  catch { B finish }
}

modified testcase backup_malloc.test : 
do_faultsim_test 3 -faults oom* -prep {
  catch { db close }
  catch { db2 close }

  forcedelete test2.db
  sqlite3 db2 test2.db
  sqlite3 db test.db
  sqlite3_backup B db2 main db main
} -body {

  set rc [B step 50]
  if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} {
    error "out of memory"
  }

} -test {
  faultsim_test_result {0 {}} 
  faultsim_integrity_check
  
  # Finalize the backup.
  catch { B finish }
  catch {db close}
  catch {db2 close}
}

Thank you!

Liziqi
2021-08-19
11:42 Reply: SIGBUS in sqlite (artifact: 224a79030e user: liziqi)
Yes, Only using java File interface to delete db files, bypassing the SQLite library. In linux, it would not affect sqlite to delete db file.

In the application, only one copy of the SQLite library.
2021-08-18
06:26 Reply: SIGBUS in sqlite (artifact: 739ff1ea09 user: liziqi)
You are right.I means that "processes" are threads.

On Linux, If "process" above is thread, Could potentially the case above we guess occur ?
04:00 Post: SIGBUS in sqlite (artifact: 68b7e7440e user: liziqi)
Hi all. We're currently on SQLite 3.28, and we've been noticing rare SIGBUS errors blaming within SQLite code. The stack trace tends to look like this:

memset
walIndexAppend
walIndexReadHdr
walTryBeginRead
sqlite3PagerSharedLock
sqlite3BtreeBeginTrans
sqlite3VdbeExec
sqlite3_step

In our case, we manipulate the same db, which located in android external storage, whithin multiple processes. And the external storage has plenty of free space left.
After I read the source code, I think it maybe a concurrent problem.
the case I guess is below:
processs A mmap 32kb memory to *-shm file. process B close the db, leads to all advisory locks within db file are released. process C open db and truncate *-shm file because all locks are released.
Meanwhile, process A access memmory which correspond to *-shm file. process A Crash.

In our case, process run normally before access 4096-th byte and crash when access 4096-th byte. So the first page(4k) in mmap is valid. And sqlite would truncate *-shm file to 3 bytes. This make us skeptical.

Could the method using sqlite be correct that multiple process manipulate the same db, such as process A, B open db, process B close, process C open...?
Could potentially the case above we guess occur ?
Could this potentially be a bug in SQLite that we can help triage?

Thank you!

Liziqi
2021-06-29
04:05 Reply: Which performance test tool should choose ? (artifact: f98a6e725a user: liziqi)
Thanks for your reply.

1. it is stated that our devices provide platform capabilities. If CLI is used as a testing tool, there may be two problems. First, if it is only for a single scenario, the CLI is definitely okay. If it involves multiple scenarios, We need to write test cases ourselves. There will be problems with missing test scenarios, which will lead to large deviations in the final test results. Do you have a specific test database or test script? If we use the same test data as yours, the test results will be more fair and creditable. Secondly, the CLI is not convenient for large-scale automated testing. It may be a problem.

2. Can you provide some details about fine-grained test measures ? Where can I find or study ? In SQlite source code ? 

I really want to know precise data after modify compiler-time options. If we write some testcases and the test resuls is good, the situation is not creditable becasue we are not only referees but also athletes.
2021-06-28
13:48 Edit: Which performance test tool should choose ? (artifact: 1256cc17cb user: liziqi)
Hi, I recently wanted to adjust the compile-time options of sqlite in our devices, but I am not sure whether this adjustment will cause performance degradation. I thought about using AndroidBench, but this software has not been updated for a long time, so I want to know, which test tool should I choose? What method do you use to test the performance of sqlite, I also want to learn it and test our sqlite performance before and after the adjustment, such as compile-time option SQLITE_OMIT_SHARED_CACHE.
11:53 Post: Which performance test tool should choose ? (artifact: 35e4e445ff user: liziqi)
Hi, I recently wanted to adjust the compile-time options of sqlite in our devices, but I am not sure whether this adjustment will cause performance degradation. I thought about using AndroidBench, but this software has not been updated for a long time, so I want to know, which test tool should I choose? What method do you use to test the performance of sqlite, I also want to learn it and test our sqlite performance before and after the adjustment, such as compile-time option SQLITE_OMIT_SHARED_CACHE.