Quantcast

Application is crashing while performing sqlite3_prepare_v2 with sqlite version 3.15.2 (intermittently)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Application is crashing while performing sqlite3_prepare_v2 with sqlite version 3.15.2 (intermittently)

ROCHAK GUPTA
Hi All,

I am using sqlite as library in multi-threaded environment where multiple
applications use sqlite queries to perform get/set operations on attributes
available in sqlite db tables. Intermittently i am seeing applications
crashing when get operation is performed which intern call
sqlite3_prepare_v2.
Crash is not frequent. One thing to notice that, I never hit this issue
when i was using 3.8.10.2 for couple of months. First time i hit the issue
only after updating 3.15.2 recently. Could anyone please help me with this?
Following is the GDB back trace for the same. Please let me know if this is
a known issue and if its fixed in latest sqlite version.
#0 0x4ffc9494 in __aeabi_memcpy8 () at ../sysdeps/arm/armv7/
multiarch/memcpy_impl.S:352
#1 <https://github.com/sqlitebrowser/sqlitebrowser/pull/1> 0x4194d514 in
whereLoopXfer (pFrom=0x19a560, pTo=0x1c14d0, db=) at
/usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
3150200/sqlite3.c:129646
#2 <https://github.com/sqlitebrowser/sqlitebrowser/issues/2> whereLoopInsert
(pTemplate=pTemplate@entry=0x19a560, pBuilder=0x1c2858, pBuilder=0x1c2858)
at /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
3150200/sqlite3.c:64414
#3 <https://github.com/sqlitebrowser/sqlitebrowser/pull/3> 0x419700f0 in
whereLoopAddBtree (pBuilder=0x1c2858, pBuilder@entry=0x0,
mPrereq=7281790634533488) at /usr/src/debug/sqlite3/3_3.15.
2.0-r0/sqlite-autoconf-3150200/sqlite3.c:130653
#4 <https://github.com/sqlitebrowser/sqlitebrowser/issues/4> 0x419892fc in
whereLoopAddAll (pBuilder=0x0) at /usr/src/debug/sqlite3/3_3.15.
2.0-r0/sqlite-autoconf-3150200/sqlite3.c:131229
#5 <https://github.com/sqlitebrowser/sqlitebrowser/issues/5> sqlite3WhereBegin
(pParse=pParse@entry=0xbec43e68, pTabList=0x0, pTabList@entry=0x1c2850,
pWhere=pWhere@entry=0xbec43cd0, pOrderBy=, pDistinctSet=0x1c2e50,
wctrlFlags=48760, iAuxArg=320) at /usr/src/debug/sqlite3/3_3.15.
2.0-r0/sqlite-autoconf-3150200/sqlite3.c:1283
#6 <https://github.com/sqlitebrowser/sqlitebrowser/issues/6> 0x4198d8e0 in
sqlite3Select (pParse=pParse@entry=0xbec43e68, p=, pDest=0x0, pDest@entry
=0xbec43e08)
at /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
3150200/sqlite3.c:119546
#7 <https://github.com/sqlitebrowser/sqlitebrowser/issues/7> 0x419b8358 in
yy_reduce (yyruleno=, yypParser=0x1b2990) at /usr/src/debug/sqlite3/3_3.15.
2.0-r0/sqlite-autoconf-3150200/sqlite3.c:135340
#8 <https://github.com/sqlitebrowser/sqlitebrowser/issues/8> sqlite3Parser
(pParse=0xbec43e68, yyminor=..., yymajor=, yyp=) at
/usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-3150200/sqlite3.c:5377
#9 <https://github.com/sqlitebrowser/sqlitebrowser/issues/9> sqlite3RunParser
(pParse=pParse@entry=0xbec43e68, zSql=0xe8 <error: Cannot access memory at
address 0xe8>,
zSql@entry=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE
<CONDITION>"..., pzErrMsg=0x1c1dd0, pzErrMsg@entry=0xbec43e58) at
/usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-3150200/sqlite3.c:6324
#10 <https://github.com/sqlitebrowser/sqlitebrowser/issues/10> 0x419bdae8
in sqlite3Prepare (db=db@entry=0x19be78,
zSql=zSql@entry=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE
<CONDITION> "..., nBytes=nBytes@entry=233, saveSqlFlag=-1094435176,
saveSqlFlag@entry=1, pReprepare=pReprepare@entry=0x0, ppStmt=ppStmt@entry=
0xbec440d8, pzTail=pzTail@entry=0x0) at /usr/src/debug/sqlite3/3_3.15.
2.0-r0/sqlite-autoconf-3150200/sqlite3.c:114126
#11 <https://github.com/sqlitebrowser/sqlitebrowser/issues/11> 0x419bdfb4
in sqlite3LockAndPrepare (db=0x19be78,
zSql=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE <CONDITION>"...,
nBytes=233, saveSqlFlag=1, pOld=0x0, ppStmt=0xbec440d8, pzTail=0x0) at
/usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
3150200/sqlite3.c:114217
#12 <https://github.com/sqlitebrowser/sqlitebrowser/issues/12> 0x419be27c
in sqlite3_prepare_v2 (db=,
zSql=zSql@entry=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE
<CONDITION> "..., nBytes=, ppStmt=ppStmt@entry=0xbec440d8,
pzTail=pzTail@entry=0x0) at /usr/src/debug/sqlite3/3_3.15.
2.0-r0/sqlite-autoconf-3150200/sqlite3.c:114293

Thanks,
Rochak Gupta
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Application is crashing while performing sqlite3_prepare_v2 with sqlite version 3.15.2 (intermittently)

Daniel Anderson
Hi Roshak,

Looks like your top function in that thread is sqlite3_prepare_v2

So I can assume 2 things:

1 - you started a thread directly on sqlite3_prepare_v2
2- you erase part of the stack trace.

if you did 1, I can only say this is not good!

if you did 2, then you are keeping information, which is bad, as missing
info prevent helping.

if you have multiple threads, the other threads info (stack trace) could be
useful for debugging, I would suggest attaching a debugger
and looking at the other threads when the crash happens

You are using multi thread application, you are probably  victim of:
 - a race condition.
- uninitialise thread local variable
- a bug in your code
- running out of memory
- etc...

look at your logs and pay attention to things like using same handle in
more than one thread
or warning messages.
also if you can reproduce the bug with a simple program, it will then be
easier to debug.





2017-03-14 22:37 GMT-04:00 ROCHAK GUPTA <[hidden email]>:

> Hi All,
>
> I am using sqlite as library in multi-threaded environment where multiple
> applications use sqlite queries to perform get/set operations on attributes
> available in sqlite db tables. Intermittently i am seeing applications
> crashing when get operation is performed which intern call
> sqlite3_prepare_v2.
> Crash is not frequent. One thing to notice that, I never hit this issue
> when i was using 3.8.10.2 for couple of months. First time i hit the issue
> only after updating 3.15.2 recently. Could anyone please help me with this?
> Following is the GDB back trace for the same. Please let me know if this is
> a known issue and if its fixed in latest sqlite version.
> #0 0x4ffc9494 in __aeabi_memcpy8 () at ../sysdeps/arm/armv7/
> multiarch/memcpy_impl.S:352
> #1 <https://github.com/sqlitebrowser/sqlitebrowser/pull/1> 0x4194d514 in
> whereLoopXfer (pFrom=0x19a560, pTo=0x1c14d0, db=) at
> /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
> 3150200/sqlite3.c:129646
> #2 <https://github.com/sqlitebrowser/sqlitebrowser/issues/2>
> whereLoopInsert
> (pTemplate=pTemplate@entry=0x19a560, pBuilder=0x1c2858, pBuilder=0x1c2858)
> at /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
> 3150200/sqlite3.c:64414
> #3 <https://github.com/sqlitebrowser/sqlitebrowser/pull/3> 0x419700f0 in
> whereLoopAddBtree (pBuilder=0x1c2858, pBuilder@entry=0x0,
> mPrereq=7281790634533488) at /usr/src/debug/sqlite3/3_3.15.
> 2.0-r0/sqlite-autoconf-3150200/sqlite3.c:130653
> #4 <https://github.com/sqlitebrowser/sqlitebrowser/issues/4> 0x419892fc in
> whereLoopAddAll (pBuilder=0x0) at /usr/src/debug/sqlite3/3_3.15.
> 2.0-r0/sqlite-autoconf-3150200/sqlite3.c:131229
> #5 <https://github.com/sqlitebrowser/sqlitebrowser/issues/5>
> sqlite3WhereBegin
> (pParse=pParse@entry=0xbec43e68, pTabList=0x0, pTabList@entry=0x1c2850,
> pWhere=pWhere@entry=0xbec43cd0, pOrderBy=, pDistinctSet=0x1c2e50,
> wctrlFlags=48760, iAuxArg=320) at /usr/src/debug/sqlite3/3_3.15.
> 2.0-r0/sqlite-autoconf-3150200/sqlite3.c:1283
> #6 <https://github.com/sqlitebrowser/sqlitebrowser/issues/6> 0x4198d8e0 in
> sqlite3Select (pParse=pParse@entry=0xbec43e68, p=, pDest=0x0, pDest@entry
> =0xbec43e08)
> at /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
> 3150200/sqlite3.c:119546
> #7 <https://github.com/sqlitebrowser/sqlitebrowser/issues/7> 0x419b8358 in
> yy_reduce (yyruleno=, yypParser=0x1b2990) at /usr/src/debug/sqlite3/3_3.15.
> 2.0-r0/sqlite-autoconf-3150200/sqlite3.c:135340
> #8 <https://github.com/sqlitebrowser/sqlitebrowser/issues/8> sqlite3Parser
> (pParse=0xbec43e68, yyminor=..., yymajor=, yyp=) at
> /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
> 3150200/sqlite3.c:5377
> #9 <https://github.com/sqlitebrowser/sqlitebrowser/issues/9>
> sqlite3RunParser
> (pParse=pParse@entry=0xbec43e68, zSql=0xe8 <error: Cannot access memory at
> address 0xe8>,
> zSql@entry=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE
> <CONDITION>"..., pzErrMsg=0x1c1dd0, pzErrMsg@entry=0xbec43e58) at
> /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
> 3150200/sqlite3.c:6324
> #10 <https://github.com/sqlitebrowser/sqlitebrowser/issues/10> 0x419bdae8
> in sqlite3Prepare (db=db@entry=0x19be78,
> zSql=zSql@entry=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE
> <CONDITION> "..., nBytes=nBytes@entry=233, saveSqlFlag=-1094435176,
> saveSqlFlag@entry=1, pReprepare=pReprepare@entry=0x0, ppStmt=ppStmt@entry=
> 0xbec440d8, pzTail=pzTail@entry=0x0) at /usr/src/debug/sqlite3/3_3.15.
> 2.0-r0/sqlite-autoconf-3150200/sqlite3.c:114126
> #11 <https://github.com/sqlitebrowser/sqlitebrowser/issues/11> 0x419bdfb4
> in sqlite3LockAndPrepare (db=0x19be78,
> zSql=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE <CONDITION>"...,
> nBytes=233, saveSqlFlag=1, pOld=0x0, ppStmt=0xbec440d8, pzTail=0x0) at
> /usr/src/debug/sqlite3/3_3.15.2.0-r0/sqlite-autoconf-
> 3150200/sqlite3.c:114217
> #12 <https://github.com/sqlitebrowser/sqlitebrowser/issues/12> 0x419be27c
> in sqlite3_prepare_v2 (db=,
> zSql=zSql@entry=0x198248 "SELECT <COLUMNS> FROM <TABLE_NAME> WHERE
> <CONDITION> "..., nBytes=, ppStmt=ppStmt@entry=0xbec440d8,
> pzTail=pzTail@entry=0x0) at /usr/src/debug/sqlite3/3_3.15.
> 2.0-r0/sqlite-autoconf-3150200/sqlite3.c:114293
>
> Thanks,
> Rochak Gupta
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>



--
Daniel
*L'action accède à la perfection quand, bien que vivant, vous êtes déjà
mort*
*Bunan*
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...