SQLite Forum

Crash while sqlite3_prepare_v2 with signal SIGFPE in SQLite version 3.31.01
Login
Second time when i hit crash again on "findElementWithHash" SQLite API, it was with signal SIGSEGV and on a different select query which usually works fine. Crash is occasional in both the cases and crashes on "findElementWithHash".

Select Query:
"select column1, column2, column3 from CurrentTable where UPPER(column1)=UPPER(?);"

Back Trace:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 sqlite3StrICmp (zRight=0x109c2c "UPPER", zLeft=<error reading variable: Cannot access memory at address 0xc>) at ../sqlite-autoconf-3310100/sqlite3.c:32794
32794 ../sqlite-autoconf-3310100/sqlite3.c: No such file or directory.
(gdb) bt
#0 sqlite3StrICmp (zRight=0x109c2c "UPPER", zLeft=<error reading variable: Cannot access memory at address 0xc>) at ../sqlite-autoconf-3310100/sqlite3.c:32794
#1 findElementWithHash (pH=0xe1e44, pH@entry=0x42d26224 <sqlite3FindFunction+76>, pKey=pKey@entry=0x109c2c "UPPER", pHash=pHash@entry=0x0) at ../sqlite-autoconf-3310100/sqlite3.c:32794
#2 0x42d26224 in sqlite3HashFind (pKey=0x109c2c "UPPER", pH=0x42d26224 <sqlite3FindFunction+76>) at ../sqlite-autoconf-3310100/sqlite3.c:32843
#3 sqlite3FindFunction (db=db@entry=0xe1cc0, zName=zName@entry=0x109c2c "UPPER", nArg=nArg@entry=1, enc=enc@entry=1 '\001', createFlag=createFlag@entry=0 '\000') at ../sqlite-autoconf-3310100/sqlite3.c:49015
#4 0x42d64b20 in resolveExprStep (pWalker=0xaeffe9e0, pExpr=0x109bf8) at ../sqlite-autoconf-3310100/sqlite3.c:97581
#5 0x42d2a1f0 in walkExpr (pWalker=pWalker@entry=0xaeffe9e0, pExpr=0x109bf8) at ../sqlite-autoconf-3310100/sqlite3.c:96627
#6 0x42d2a218 in walkExpr (pWalker=pWalker@entry=0xaeffe9e0, pExpr=pExpr@entry=0x109b78) at ../sqlite-autoconf-3310100/sqlite3.c:96631
#7 0x42d4f5ec in sqlite3WalkExpr (pExpr=0x109b78, pWalker=0xaeffe9e0) at ../sqlite-autoconf-3310100/sqlite3.c:99342
#8 sqlite3ResolveExprNames (pNC=pNC@entry=0xaeffea4c, pExpr=0x109b78) at ../sqlite-autoconf-3310100/sqlite3.c:33021
#9 0x42d57b5c in resolveSelectStep (pWalker=<optimized out>, p=0x1084f8) at ../sqlite-autoconf-3310100/sqlite3.c:98385
#10 0x42d2a05c in sqlite3WalkSelect (pWalker=pWalker@entry=0xaeffead0, p=p@entry=0x1084f8) at ../sqlite-autoconf-3310100/sqlite3.c:96749
#11 0x42d2c96c in sqlite3WalkSelect (p=0x1084f8, pWalker=0xaeffead0) at ../sqlite-autoconf-3310100/sqlite3.c:98613
#12 sqlite3ResolveSelectNames (pOuterNC=0x0, p=0x1084f8, pParse=0xaefff220) at ../sqlite-autoconf-3310100/sqlite3.c:33077
#13 sqlite3SelectPrep (pParse=0xaefff220, p=0x1084f8, pOuterNC=0x0) at ../sqlite-autoconf-3310100/sqlite3.c:2129
#14 0x42d7f008 in sqlite3Select (pParse=pParse@entry=0xaefff220, p=0x1084f8, pDest=0x4242a9b4 <gShmData>, pDest@entry=0xaeffecf8) at ../sqlite-autoconf-3310100/sqlite3.c:133637
#15 0x42db10a4 in yy_reduce (yyLookahead=<optimized out>, pParse=<optimized out>, yyLookaheadToken=..., yyruleno=136, yypParser=0xaeffed10) at ../sqlite-autoconf-3310100/sqlite3.c:155887
#16 sqlite3Parser (yyminor=..., yymajor=<optimized out>, yyp=0xaeffed10) at ../sqlite-autoconf-3310100/sqlite3.c:26109
#17 sqlite3RunParser (pParse=pParse@entry=0xaefff220, zSql=<optimized out>, zSql@entry=0x42e44268 "select column1, column2, column3 from CurrentTable where UPPER(column1)=UPPER(?);",
pzErrMsg=pzErrMsg@entry=0xaefff210) at ../sqlite-autoconf-3310100/sqlite3.c:27383
#18 0x42db600c in sqlite3Prepare (db=db@entry=0xe1cc0, zSql=zSql@entry=0x42e44268 "select column1, column2, column3 from CurrentTable where UPPER(column1)=UPPER(?);", nBytes=nBytes@entry=-1,
prepFlags=prepFlags@entry=128, pReprepare=pReprepare@entry=0x0, ppStmt=ppStmt@entry=0xaefff3d8, pzTail=pzTail@entry=0x0) at ../sqlite-autoconf-3310100/sqlite3.c:127575
#19 0x42db6394 in sqlite3LockAndPrepare (db=0xe1cc0, zSql=0x42e44268 "select column1, column2, column3 from CurrentTable where UPPER(column1)=UPPER(?);", nBytes=-1, prepFlags=128, pOld=0x0,
ppStmt=0xaefff3d8, pzTail=0x0) at ../sqlite-autoconf-3310100/sqlite3.c:127647
#20 0x42db64cc in sqlite3_prepare_v2 (db=<optimized out>, zSql=<optimized out>, nBytes=nBytes@entry=-1, ppStmt=ppStmt@entry=0xaefff3d0, pzTail=pzTail@entry=0x0) at ../sqlite-autoconf-3310100/sqlite3.c:127731