Hi there,

I experienced a SIGSEGV running the following code:

    sqlite3* memory_db = NULL;
    sqlite3_open("file::memory:?cache=shared", &memory_db);

To be exact, it occurs when executed a second time. The whole function looks 
like this

    void init() {
      sqlite3* memory_db = NULL;
      sqlite3_open("file::memory:?cache=shared", &memory_db);

      // fill memory_db
      // attach memory_db to other databases

      sqlite3_close(memory_db);
      memory_db = NULL;

     // close other database connections
    }

Executing init() the first time yields no error, and everything works as 
expected.

Executing init() the second time yields the SIGSEGV on the sqlite3_open call.

Do you have any idea about why this could be? There seems to be some kind of 
state stored somewhere. Are there any traces of the memory database that need 
to be closed/removed/freed/released?

Thanks a lot for your help.

All the best,
Niels

Reply via email to