I build sqlite3 for running on a linux powerpc installation, and it
currently breaks.

I've tried versions 3.6.18 and 3.6.20, both the amalgation release and
the regular.  I use gcc-4.4.1.

When I run any 'CREATE TABLE' command (possibly others; haven't tested),
sqlite3 segfaults.

Output from gdb:

[Thread debugging using libthread_db enabled]
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table foo (bar INTEGER);
[New Thread 0x48830490 (LWP 21654)]
[Thread 0x48830490 (LWP 21654) exited]

Program received signal SIGSEGV, Segmentation fault.
0x0ff749f0 in isLookaside (db=0x12, p=0x230) at sqlite3.c:16075
16075   sqlite3.c: No such file or directory.
        in sqlite3.c
(gdb) bt
#0  0x0ff749f0 in isLookaside (db=0x12, p=0x230) at sqlite3.c:16075
#1  sqlite3DbMallocSize (db=0x12, p=0x230) at sqlite3.c:16090
#2  0x0ff8aa3c in sqlite3VdbeMemGrow (pMem=0x1002ddf0, n=344, preserve=0)
    at sqlite3.c:46198
#3  0x0ff9cd58 in allocateCursor (p=0x1002cda8, iCur=<value optimized out>, 
    nField=5, iDb=0, isBtreeCursor=<value optimized out>) at sqlite3.c:51721
#4  0x0ffd3bb4 in sqlite3VdbeExec (p=0x1002cda8) at sqlite3.c:55046
#5  0x0ffc7384 in sqlite3Step (pStmt=0x1002cda8) at sqlite3.c:50609
#6  sqlite3_step (pStmt=0x1002cda8) at sqlite3.c:50668
#7  0x100049e8 in shell_exec (db=0x1001e5b0, 
    zSql=0x1001e528 "create table foo (bar INTEGER);", pArg=0xbfcc951c, 
    pzErrMsg=0xbfcc9418, xCallback=<value optimized out>) at shell.c:1863
#8  0x100050c8 in process_input (p=0xbfcc951c, in=0x0) at shell.c:3141
#9  0x100079e4 in main (argc=<value optimized out>, argv=<value optimized out>)
    at shell.c:3504

This happens after running 'CREATE TABLE foo (bar INTEGER);'.

RedHat's bug:

https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=494266

seems very relevant.  Their solution is to enable -fno-strict-aliasing,
which fixes the problem for me as well, so the problem seems to be
erroneous aliasing.  Whether any problems occur (with less serious
symptoms) on x86 or other platforms is unknown to me.  It appears to
work fine for me on x86.

I imagine the best fix is to not use dubious pointer aliasing, but a
quick-fix would be to enable -fno-strict-aliasing on powerpc.  This was
briefly discussed at #sqlite on freenode today (2009-11-09).

-- 
Henrik Grindal Bakken <[email protected]>
PGP ID: 8D436E52
Fingerprint: 131D 9590 F0CF 47EF 7963  02AF 9236 D25A 8D43 6E52

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to