Note that there are some explanatory texts on larger screens.

plurals
  1. POSqlite3 SIGSEGVs with Valgrind
    primarykey
    data
    text
    <p>I just started to use Valgrind to check a C++ application for memory leaks. But every time the program tries to open an Sqlite3 database it terminates with a SIGSEGV. This does not happen when it is run without Valgrind.</p> <p>The simplest program to demonstrate this is as follows</p> <pre><code>int main (int argc, char** argv) { sqlite3 *db = 0; sqlite3_open("/tmp/mydb.sqlite", &amp;db); return 0; } </code></pre> <p>Valgrind reports:</p> <pre><code>==29227== Jump to the invalid address stated on the next line ==29227== at 0x0: ??? ==29227== by 0x48C606: mallocWithAlarm (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x477F71: sqlite3Malloc (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x4BD7F5: pthreadMutexAlloc (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x47740F: sqlite3_initialize (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x48929D: openDatabase (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x10014B507: main (in /usr/local/bin/outbound) ==29227== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==29227== ==29227== ==29227== Process terminating with default action of signal 11 (SIGSEGV) ==29227== Bad permissions for mapped region at address 0x0 ==29227== at 0x0: ??? ==29227== by 0x48C606: mallocWithAlarm (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x477F71: sqlite3Malloc (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x4BD7F5: pthreadMutexAlloc (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x47740F: sqlite3_initialize (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x48929D: openDatabase (in /opt/local/lib/libsqlite3.0.8.6.dylib) ==29227== by 0x10014B507: main (in /usr/local/bin/outbound) </code></pre> <p>What may cause this behaviour in Valgrind?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload