Please clarify (for the second time):

>I tested the in-memory with multi-thread (but inserts/deletes are in
>a lock)

What does "with multi-thread" mean?


---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Wang, Peter (Xu)
>Sent: Thursday, 2 November, 2017 19:23
>To: sqlite-users@mailinglists.sqlite.org
>Cc: wangxu198...@gmail.com
>Subject: [sqlite] deadlock between query and insert in-memory db
>
>Can anyone help me on this?
>
>Thanks
>Peter
>
>From: Wang, Peter (Xu)
>Sent: Tuesday, October 31, 2017 4:19 PM
>To: 'sqlite-users@mailinglists.sqlite.org' <sqlite-
>us...@mailinglists.sqlite.org>
>Cc: wangxu198...@gmail.com
>Subject: Segfault when query again in-memory db
>
>Hi
>I am trying to provide a asychnonous queue based on sqlite3 in Python
>Current, I already passted the file based tests with my queue
>When switching file to in-memory db, I keep meeting a "segfault"
>issue when running the same tests test suite
>
>Can anyone help me out of this situation?
>
>
>I tested the in-memory with multi-thread (but inserts/deletes are in
>a lock)
>Here is the trace of the core file:
>
>(gdb) bt
>#0  sqlite3_value_type (pVal=0x0) at sqlite3.c:72512
>#1  0x00007fda2a34fd86 in sqlite3_column_type (pStmt=0x7fda08004178,
>i=<optimized out>) at sqlite3.c:73318
>#2  0x00007fda2a607987 in _pysqlite_fetch_one_row
>(self=self@entry=0x7fda2a204b20) at /build/python2.7-
>1tJBSB/python2.7-2.7.12/Modules/_sqlite/cursor.c:352
>#3  0x00007fda2a6089c1 in _pysqlite_query_execute
>(self=0x7fda2a204b20, multiple=<optimized out>, args=<optimized out>)
>    at /build/python2.7-1tJBSB/python2.7-
>2.7.12/Modules/_sqlite/cursor.c:711
>#4  0x00000000004b0cb3 in PyObject_Call () at
>../Objects/abstract.c:2546
>#5  0x00000000004ce5d0 in PyEval_CallObjectWithKeywords () at
>../Python/ceval.c:4219
>#6  0x00007fda2a609106 in pysqlite_connection_execute
>(self=<optimized out>, args=('SELECT _id, data FROM queue_default
>ORDER BY _id ASC LIMIT 1', ()))
>    at /build/python2.7-1tJBSB/python2.7-
>2.7.12/Modules/_sqlite/connection.c:1262
>#7  0x00000000004cb945 in call_function (oparg=<optimized out>,
>pp_stack=0x7fda19ff9fc0) at ../Python/ceval.c:4350
>#8  PyEval_EvalFrameEx () at ../Python/ceval.c:2987
>#9  0x00000000004c2765 in PyEval_EvalCodeEx () at
>../Python/ceval.c:3582
>#10 0x00000000004ca8d1 in fast_function (nk=0, na=<optimized out>,
>n=<optimized out>, pp_stack=0x7fda19ffa1d0, func=<function at remote
>0x7fda2a83c050>)
>    at ../Python/ceval.c:4445
>#11 call_function (oparg=<optimized out>, pp_stack=0x7fda19ffa1d0) at
>../Python/ceval.c:4370
>#12 PyEval_EvalFrameEx () at ../Python/ceval.c:2987
>#13 0x00000000004c9d8f in fast_function (nk=<optimized out>,
>na=<optimized out>, n=<optimized out>, pp_stack=0x7fda19ffa320,
>    func=<function at remote 0x7fda2a8416e0>) at
>../Python/ceval.c:4435
>#14 call_function (oparg=<optimized out>, pp_stack=0x7fda19ffa320) at
>../Python/ceval.c:4370
>#15 PyEval_EvalFrameEx () at ../Python/ceval.c:2987
>#16 0x00000000004c2765 in PyEval_EvalCodeEx () at
>../Python/ceval.c:3582
>#17 0x00000000004ca099 in fast_function (nk=1, na=<optimized out>,
>n=<optimized out>, pp_stack=0x7fda19ffa530, func=<function at remote
>0x7fda2a841758>)
>    at ../Python/ceval.c:4445
>#18 call_function (oparg=<optimized out>, pp_stack=0x7fda19ffa530) at
>../Python/ceval.c:4370
>#19 PyEval_EvalFrameEx () at ../Python/ceval.c:2987
>#20 0x00000000004c2765 in PyEval_EvalCodeEx () at
>../Python/ceval.c:3582
>#21 0x00000000004de8b8 in function_call.lto_priv () at
>../Objects/funcobject.c:523
>#22 0x00000000004b0cb3 in PyObject_Call () at
>../Objects/abstract.c:2546
>#23 0x00000000004c6ad1 in ext_do_call (nk=<optimized out>,
>na=<optimized out>, flags=<optimized out>, pp_stack=0x7fda19ffa7e8,
>    func=<function at remote 0x7fda29fd6c80>) at
>../Python/ceval.c:4664
>#24 PyEval_EvalFrameEx () at ../Python/ceval.c:3026
>#25 0x00000000004c9d8f in fast_function (nk=<optimized out>,
>na=<optimized out>, n=<optimized out>, pp_stack=0x7fda19ffa930,
>    func=<function at remote 0x7fda2da20758>) at
>../Python/ceval.c:4435
>#26 call_function (oparg=<optimized out>, pp_stack=0x7fda19ffa930) at
>../Python/ceval.c:4370
>#27 PyEval_EvalFrameEx () at ../Python/ceval.c:2987
>#28 0x00000000004c9d8f in fast_function (nk=<optimized out>,
>na=<optimized out>, n=<optimized out>, pp_stack=0x7fda19ffaa80,
>---Type <return> to continue, or q <return> to quit---
>    func=<function at remote 0x7fda2da208c0>) at
>../Python/ceval.c:4435
>#29 call_function (oparg=<optimized out>, pp_stack=0x7fda19ffaa80) at
>../Python/ceval.c:4370
>#30 PyEval_EvalFrameEx () at ../Python/ceval.c:2987
>#31 0x00000000004c2765 in PyEval_EvalCodeEx () at
>../Python/ceval.c:3582
>#32 0x00000000004de6fe in function_call.lto_priv () at
>../Objects/funcobject.c:523
>#33 0x00000000004b0cb3 in PyObject_Call () at
>../Objects/abstract.c:2546
>#34 0x00000000004f492e in instancemethod_call.lto_priv () at
>../Objects/classobject.c:2602
>#35 0x00000000004b0cb3 in PyObject_Call () at
>../Objects/abstract.c:2546
>#36 0x00000000004ce5d0 in PyEval_CallObjectWithKeywords () at
>../Python/ceval.c:4219
>#37 0x0000000000597e32 in t_bootstrap () at
>../Modules/threadmodule.c:620
>#38 0x00007fda2d77f6ba in start_thread (arg=0x7fda19ffb700) at
>pthread_create.c:333
>#39 0x00007fda2d4b53dd in clone () at
>../sysdeps/unix/sysv/linux/x86_64/clone.S:109
>
>Here is the python trace:
>
>(gdb) py-bt
>Traceback (most recent call first):
>  File "/home/user/Documents/persist-queue/persistqueue/sqlbase.py",
>line 140, in _select
>    def _select(self, *args):
>  File "/home/user/Documents/persist-queue/persistqueue/sqlqueue.py",
>line 49, in _pop
>    row = self._select()
>  File "/home/wangp11/Documents/persist-
>queue/persistqueue/sqlqueue.py", line 67, in get
>    pickled = self._pop()
>  File "/home/user/Documents/persist-queue/tests/test_sqlqueue.py",
>line 105, in consumer
>    x = m_queue.get(block=True)
>  File "/usr/lib/python2.7/threading.py", line 754, in run
>    self.__target(*self.__args, **self.__kwargs)
>  File "/usr/lib/python2.7/threading.py", line 801, in
>__bootstrap_inner
>    self.run()
>  File "/usr/lib/python2.7/threading.py", line 774, in __bootstrap
>    self.__bootstrap_inner()
>_______________________________________________
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to