On 10/27/15, Lohmann, Niels, Dr. (CQTN) <niels.lohmann at carmeq.com> wrote:
> Hi there,
>
> I experienced a SIGSEGV running the following code:

Can you provide us with a stack trace at the point of the crash?

>
>     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
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to