If you are calling sqlite3_bind_xxxx to bind parameters, what are you passing 
as the last parameter? Try SQLITE_TRANSIENT to force SQLite to make a copy of 
the value right away.  Maybe currently you have values going out of scope 
before step is called.

Eric
________________________________
From: Leroy Klompenhouwer<mailto:l.klompenhou...@tmx.nl>
Sent: ?6/?30/?2015 9:18 AM
To: sqlite-users at mailinglists.sqlite.org<mailto:sqlite-users at 
mailinglists.sqlite.org>
Subject: [sqlite] Segmentation faults when calling sqlite3_step

We are experiencing random segmentation faults when calling the function 
sqlite3_step(). We use prepared statements in a transaction to insert records 
in the database.

We have the following setup:

- SQLite3.8.9
- Linux 32bit
- Armv6
- SDCard with ext3 to store the database


Can anyone explain what is happening?


Leroy


Coredump output

#0  0x407ddfb8 in pcache1RemoveFromHash (pPage=pPage at entry=0x5408a100) at 
sqlite3.c:40329

#1  0x407ef850 in pcache1FetchStage2 (pCache=pCache at entry=0x534ebca0, 
iKey=iKey at entry=78573, createFlag=createFlag at entry=2) at sqlite3.c:40569

#2  0x407efa80 in pcache1Fetch (p=0x534ebca0, iKey=78573, createFlag=2) at 
sqlite3.c:40694

#3  0x40816690 in sqlite3PcacheFetchStress (ppPage=<synthetic pointer>, 
pgno=78573, pCache=0x5391f120) at sqlite3.c:39495

#4  sqlite3PagerAcquire (pPager=0x5391f048, pgno=pgno at entry=78573, 
ppPage=0x4ab31474, ppPage at entry=0x4ab3146c, flags=0) at sqlite3.c:46910

#5  0x40816a28 in btreeGetPage (pBt=0x43c00b50, pgno=78573, ppPage=ppPage at 
entry=0x4ab31544, flags=<optimized out>) at sqlite3.c:54735

#6  0x40816a7c in getAndInitPage (pBt=<optimized out>, pgno=<optimized out>, 
ppPage=0x4ab31544, bReadonly=<optimized out>) at sqlite3.c:54790

#7  0x4081a9e0 in balance_nonroot (bBulk=<optimized out>, isRoot=0, 
aOvflSpace=0x54174710 "\310.\234SP\v\300C\320E\027T", iParentIdx=<optimized 
out>, pParent=0x53a436e8) at sqlite3.c:59731

#8  balance (pCur=0x0, pCur at entry=0x4080e1b0 <sqlite3MemMalloc>) at 
sqlite3.c:60469

#9  0x4081da60 in sqlite3BtreeInsert (pCur=0x4080e1b0 <sqlite3MemMalloc>, 
pKey=<optimized out>, nKey=<optimized out>, pData=0x4086d778, nData=nData at 
entry=0, nZero=nZero at entry=0, appendBias=appendBias at entry=0,

    seekResult=0) at sqlite3.c:60655

#10 0x4083adb4 in sqlite3VdbeExec (p=0x3, p at entry=0x53ffb940) at 
sqlite3.c:75444

#11 0x4083e828 in sqlite3Step (p=0x53ffb940) at sqlite3.c:69347

#12 sqlite3_step (pStmt=<optimized out>) at sqlite3.c:3877

#13 sqlite3_step (pStmt=<optimized out>) at sqlite3.c:3864


Detailed output:

#0  0x407ddfb8 in pcache1RemoveFromHash (pPage=pPage at entry=0x5408a100) at 
sqlite3.c:40329

        h = <optimized out>

        pCache = 0x534ebca0

        pp = 0x7df

#1  0x407ef850 in pcache1FetchStage2 (pCache=pCache at entry=0x534ebca0, 
iKey=iKey at entry=78573, createFlag=createFlag at entry=2) at sqlite3.c:40569

        pOther = <optimized out>

        nPinned = <optimized out>

        pGroup = 0x534ebcd0

        pPage = 0x5408a100

#2  0x407efa80 in pcache1Fetch (p=0x534ebca0, iKey=78573, createFlag=2) at 
sqlite3.c:40694

        pCache = 0x534ebca0

        pPage = 0x0

#3  0x40816690 in sqlite3PcacheFetchStress (ppPage=<synthetic pointer>, 
pgno=78573, pCache=0x5391f120) at sqlite3.c:39495

        pPg = <optimized out>

#4  sqlite3PagerAcquire (pPager=0x5391f048, pgno=pgno at entry=78573, 
ppPage=0x4ab31474, ppPage at entry=0x4ab3146c, flags=0) at sqlite3.c:46910

        pBase = <optimized out>

        rc = 0

        pPg = 0x0

        iFrame = 1082188208

        noContent = 0

        bMmapOk = <optimized out>

#5  0x40816a28 in btreeGetPage (pBt=0x43c00b50, pgno=78573, ppPage=ppPage at 
entry=0x4ab31544, flags=<optimized out>) at sqlite3.c:54735

        rc = 1399798980

        pDbPage = 0x40816a28 <btreeGetPage+32>

#6  0x40816a7c in getAndInitPage (pBt=<optimized out>, pgno=<optimized out>, 
ppPage=0x4ab31544, bReadonly=<optimized out>) at sqlite3.c:54790

        rc = <optimized out>

#7  0x4081a9e0 in balance_nonroot (bBulk=<optimized out>, isRoot=0, 
aOvflSpace=0x54174710 "\310.\234SP\v\300C\320E\027T", iParentIdx=<optimized 
out>, pParent=0x53a436e8) at sqlite3.c:59731

        leafCorrection = <optimized out>

        leafData = <optimized out>

        pageFlags = <optimized out>

        apOld = {0xffffffff, 0x53bc8de8, 0x533c2520}

        aSpace1 = <optimized out>

        pBt = 0x43c00b50

        nMaxCells = 1403269792

        subtotal = <optimized out>

        szScratch = <optimized out>

        pRight = 0x2 <Address 0x2 out of bounds>

        nNew = 0

        nxDiv = 0

        iOvflSpace = 0

        cntOld = {80464896, 0, 0, 78580, 1403366712}

        apCell = 0x0

        i = 0

        apNew = {0x5391f048, 0x4cbcc00, 0x0, 0x0, 0x53a5ad38}

        abDone = "\000\000\000\000"

        aPgno = {1402073376, 78580, 1402073376, 1715, 6}

        aPgOrder = {1087295488, 0, 124, 0, 1136659280}

        j = <optimized out>

        rc = 0

        iSpace1 = 0

        szNew = {17, 17, 1082063336, 78580, 1402073160}

        pgno = 1403366712

        k = <optimized out>

        apDiv = {0x5418e14f "", 0x5418e13e ""}

        cntNew = {1404621896, 746250, 0, 65540, 1082010372}

        szCell = <optimized out>

        nCell = 0

        nOld = 1403269800

        usableSpace = <optimized out>

        aPgFlags = {46552, 21503, 2, 0, 5456}

#8  balance (pCur=0x0, pCur at entry=0x4080e1b0 <sqlite3MemMalloc>) at 
sqlite3.c:60469

        pSpace = 0x5418def8 "\350\336\030T\350\336\030Tl"

        pParent = 0x53a436e8

        iIdx = <optimized out>

        iPage = 1253250376

        pPage = 0x18

        rc = <optimized out>

        nMin = 3

        aBalanceQuickSpace = "\210h\266 at N\001\000\000\004\000\001@("

        pFree = 0x17 <Address 0x17 out of bounds>

#9  0x4081da60 in sqlite3BtreeInsert (pCur=0x4080e1b0 <sqlite3MemMalloc>, 
pKey=<optimized out>, nKey=<optimized out>, pData=0x4086d778, nData=nData at 
entry=0, nZero=nZero at entry=0, appendBias=appendBias at entry=0,

    seekResult=0) at sqlite3.c:60655

        rc = 13

        loc = 1082629864

        szNew = 1410121556

        idx = <optimized out>

        pPage = 0x0

        p = <optimized out>

        pBt = <optimized out>

        oldCell = <optimized out>

        newCell = 0x533c2520 "\001\001"

#10 0x4083adb4 in sqlite3VdbeExec (p=0x3, p at entry=0x53ffb940) at 
sqlite3.c:75444

        pC = 0x541746a8

        pCrsr = <optimized out>

        nKey = <optimized out>

        zKey = <optimized out>

        pc = <optimized out>

        aOp = 0x53ffb940

        pOp = 0x53ffd4a8

        rc = <optimized out>

        db = <optimized out>

        resetSchemaOnFault = <optimized out>

        encoding = 9 '\t'

        iCompare = <optimized out>

        nVmStep = 0

        nProgressLimit = 0

        aMem = 0x14

        pIn1 = <optimized out>

        pIn2 = <optimized out>

        pIn3 = <optimized out>

        pOut = 0x53ffd628

        aPermute = <optimized out>

        lastRowid = <optimized out>

#11 0x4083e828 in sqlite3Step (p=0x53ffb940) at sqlite3.c:69347

        db = 0x53a5ad38

        rc = <optimized out>

#12 sqlite3_step (pStmt=<optimized out>) at sqlite3.c:3877

        rc2 = 0

        db = <optimized out>

        rc = <optimized out>

#13 sqlite3_step (pStmt=<optimized out>) at sqlite3.c:3864

        v = <optimized out>


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

Reply via email to