Re: bus error on sparc machines

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: bus error on sparc machines

Tal Tabakman-2
Hi

I have a crash when running a sqlite based app on solaris machines in 64
bits mode. the crash is actually a bus error when executing an sqlite_exec.

As recommended in this forum ,when running with gdb, I found that the crash
is in this line:


pIndex->azColl[i] = zColl;



This is the stack in gdb:

-----------------------------------

 =>[1] sqlite3CreateIndex(pParse = 0x1054c7078, pName1 = 0x1054b40b0,

pName2 = 0x1054b40d0, pTblName = 0x10549ecc8, pList = 0x102e86cf8, onError
= 0, pStart = 0x1054b4030, pEnd = 0x1054b4170, sortOrder = 0, ifNotExist =
0), line 82187 in "sqlite3.c"

  [2] yy_reduce(yypParser = 0x1054b3fd8, yyruleno = 243), line 108821 in
"sqlite3.c"

  [3] sqlite3Parser(yyp = 0x1054b3fd8, yymajor = 1, yyminor = RECORD,
pParse = 0x1054c7078), line 109257 in "sqlite3.c"

  [4] sqlite3RunParser(pParse = 0x1054c7078, zSql = 0x1068309c8 "CREATE
INDEX IDX_OBJ on entries (obj_id, path);;", pzErrMsg = 0xffffffff73cfb178),
line 110082 in "sqlite3.c"

  [5] sqlite3Prepare(db = 0x1053e7858, zSql = 0x1068309c8 "CREATE INDEX
IDX_OBJ on entries (obj_id, path);;", nBytes = -1, saveSqlFlag = 0,
pReprepare = (nil), ppStmt = 0xffffffff73cfb480, pzTail =
0xffffffff73cfb488), line 92441 in "sqlite3.c"

  [6] sqlite3LockAndPrepare(db = 0x1053e7858, zSql = 0x1068309c8 "CREATE
INDEX IDX_OBJ on entries (obj_id, path);;", nBytes = -1, saveSqlFlag = 0,
pOld = (nil), ppStmt = 0xffffffff73cfb480, pzTail = 0xffffffff73cfb488),
line 92533 in "sqlite3.c"

  [7] sqlite3_prepare(db = 0x1053e7858, zSql = 0x1068309c8 "CREATE INDEX
IDX_OBJ on entries (obj_id, path);;", nBytes = -1, ppStmt =
0xffffffff73cfb480, pzTail = 0xffffffff73cfb488), line 92596 in "sqlite3.c"

  [8] sqlite3_exec(db = 0x1053e7858, zSql = 0x1068309c8 "CREATE INDEX
IDX_OBJ on entries (obj_id, path);;", xCallback = (nil), pArg = (nil),
pzErrMsg = 0xffffffff73cfb5d8), line 89103 in "sqlite3.c"

------------------------------------------------------------

What i get is a bus error, and it is related to bits alignment for azColl

Type of azColl is char ** e.g. on solaris64 (lp64) it must be % 8
(otherwise one gets SIGBUS, as far as I know...)


this is the pIndex struct content

print  *pIndex *pIndex = {

    zName      = 0x1054931d6 "IDX_OBJ"

    nColumn    = 2

    aiColumn   = 0x1054931cc

    aiRowEst   = 0x1054931b0

    pTable     = 0x105493418

    tnum       = 0

    onError    = '\0'

    autoIndex  = '\0'

    bUnordered = '\0'

    zColAff    = (nil)

    pNext      = (nil)

    pSchema    = 0x1053e8d88

    aSortOrder = 0x1054931d4 ""

    azColl     = 0x1054931bc

}


The address of azColl is 0x1054931bc and it is %4 (but not 8) , i.e.


p (long)0x1054931bc

$1 = 88682940

(gdb) p 88682940.0/8

$2 = 11085367.5




any clue what can cause that ? is there a special build isntruction for
compiling sqlite.c on solaris ?

please advice

Tal
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: bus error on sparc machines

Simon Slavin-3

On 9 Sep 2012, at 12:49pm, Tal Tabakman <[hidden email]> wrote:

> "CREATE
> INDEX IDX_OBJ on entries (obj_id, path);;"

Just on the offchance, please try it with just one semi-colon, and again with no semi-colons.  I don't think that's the problem, but it might show up something different.

However, bus errors are often the result of something in your own code, or of not checking the result codes returned by all your previous SQLite3 calls.  Are you checking the integers returned by all the SQLite3 calls and making sure they're SQLITE_OK ?

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: bus error on sparc machines

Pavel Ivanov-2
> However, bus errors are often the result of something in your own code, or of not checking the result codes returned by all your previous SQLite3 calls.

Simon,

You are confusing bus errors with segmentation faults. They are
different things and bus errors inside SQLite can never be caused by
the code using SQLite.


Pavel


On Sun, Sep 9, 2012 at 9:34 AM, Simon Slavin <[hidden email]> wrote:

>
> On 9 Sep 2012, at 12:49pm, Tal Tabakman <[hidden email]> wrote:
>
>> "CREATE
>> INDEX IDX_OBJ on entries (obj_id, path);;"
>
> Just on the offchance, please try it with just one semi-colon, and again with no semi-colons.  I don't think that's the problem, but it might show up something different.
>
> However, bus errors are often the result of something in your own code, or of not checking the result codes returned by all your previous SQLite3 calls.  Are you checking the integers returned by all the SQLite3 calls and making sure they're SQLITE_OK ?
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: bus error on sparc machines

Richard Hipp-3
In reply to this post by Tal Tabakman-2
On Sun, Sep 9, 2012 at 7:49 AM, Tal Tabakman <[hidden email]> wrote:

> Hi
>
> I have a crash when running a sqlite based app on solaris machines in 64
> bits mode. the crash is actually a bus error when executing an sqlite_exec.
>


There was a bug that effected Sparc back in version 3.7.9.  We fixed that
bug, and subsequently obtained a Sparc machine for testing purposes to
prevent it from happening again.  All of our tests work fine on Sparc
Solaris in recent versions of SQLite.

What version of SQLite did you say you were running?


--
D. Richard Hipp
[hidden email]
_______________________________________________
sqlite-users mailing list
[hidden email]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users