On Mar 14, 2009, at 5:47 AM, David Jones wrote:
> I am compiling 3.6.11 from amalgamated sources on Solaris and I get a
> Segmentation Fault whenever I type something at the shell. Pasted
> below are some information which might be helpful. Does anyone else
> see this error or have a workaround?
>
> I get the same behavior when I run in gdb or just from the command
> line. In both cases, as soon as I type anything at the shell, such as
> ".tables" or a create table command, it immediately crashes. I am
> compiling statically and installing into my homedir, which I don't
> imagine should cause any problems. If I compile shared, I get the same
> error.
>
> It looks like previous bugs (700, 1158 in particular) saw
> memory-alignment-based crashes. In the traceback, you can see that
> there is an assignment to a memory location like 0x10591c. This
> indicates that it is not 16-byte aligned. If I add __attribute__
> ((__aligned__(16))) to the definition of prereqRight, I see a
> different alignment, but still not correct (something like 0x10588c).
>
> $ gcc -v
> Using built-in specs.
> Target: sparc-sun-solaris2.10
> Configured with: ./configure --prefix=/opt/gcc/4.2.4
> --enable-languages=c,c++,fortran,obj-c++,objc --disable-libgcj
> --disable-nls --with-gmp=/usr/local --with-mpfr=/usr/local
> --enable-threads=posix --with-cpu=ultrasparc
> --host=sparc-sun-solaris2.10
> Thread model: posix
> gcc version 4.2.4
> $ CFLAGS="-DSQLITE_DEBUG -g" ./configure --prefix=$HOME
> --enable-static --disable-shared
> $ make && make install
> $ gdb ~/bin/sqlite3
> ..snip..
> This GDB was configured as "sparc-sun-solaris2.9"...
> (gdb) run test.sq3
> Starting program: /home/fairway/a/enedev/bin/sqlite3 test.sq3
> SQLite version 3.6.11
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> .tables
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x000b8b20 in exprAnalyze (pSrc=0x102910, pWC=0x1058c4, idxTerm=1)
> at sqlite3.c:82139
> 82139 pTerm->prereqRight = exprTableUsage(pMaskSet, pExpr-
> >pRight);
> (gdb) list 82135,82143
> 82135 | exprSelectTableUsage(pMaskSet,
> pExpr->pSelect);
> 82136 }else if( op==TK_ISNULL ){
> 82137 pTerm->prereqRight = 0;
> 82138 }else{
> 82139 pTerm->prereqRight = exprTableUsage(pMaskSet, pExpr-
> >pRight);
> 82140 }
> 82141 prereqAll = exprTableUsage(pMaskSet, pExpr);
> 82142 if( ExprHasProperty(pExpr, EP_FromJoin) ){
> 82143 Bitmask x = getMask(pMaskSet, pExpr->iRightJoinTable);
> (gdb) print pTerm
> $1 = (WhereTerm *) 0x105904
> (gdb) print pTerm->prereqRight
> $2 = 0
> (gdb) print &pTerm->prereqRight
> $3 = (Bitmask *) 0x10591c
prereqRight is an unsigned 64-bit integer. But aligned to a 4-byte
boundary,
not an 8-byte one. I guess that's a problem. Could be similar to this
one:
http://www.sqlite.org/cvstrac/tktview/tn=3553
Is this a 32-bit build?
Can you post a ticket for this crash? It's not going to get fixed
today...
Dan.
> (gdb) print pMaskSet
> $4 = (WhereMaskSet *) 0x10597c
> (gdb) print pExpr->pRight
> $5 = (Expr *) 0x0
> (gdb) print &pExpr->pRight
> $6 = (Expr **) 0x1023d4
> (gdb) print *pMaskSet
> $7 = {n = 1, ix = {1, 0 <repeats 63 times>}}
> (gdb) print *pExpr
> $8 = {op = 19 '\023', affinity = 0 '\0', flags = 132, pColl = 0x0,
> pLeft = 0x102430, pRight = 0x0, pList = 0x0, token = {z = 0x0, dyn
> = 0,
> n = 0}, span = {
> z = 0xcd10a "name NOT LIKE 'sqlite_%'UNION ALL SELECT name FROM
> sqlite_temp_master WHERE type IN ('table','view') ORDER BY 1", dyn =
> 0, n = 24},
> iTable = 0, iColumn = 0, pAggInfo = 0x0, iAgg = -1, iRightJoinTable
> = 0,
> pSelect = 0x0, pTab = 0x0, nHeight = 3}
> (gdb)
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users