Hello,
I am consistantly getting a memory fault in sqlite both through the tclsqlite
shared library and the sqlite3 executable when I try to create a table. I have
tried both sqlite 3.2.1 and 2.8.16. The TCL Versions tried are 8.4.6 and 8.4.9.
I have had success on 32bit HPUX 11.11 but when porting to 64 bit we started
receiving these errors.
I will note that both TCL and SQLite where compiled with a 64 bit gcc compiler.
When I traced this down, it seems that the code blows up on the following line
in printf.c ->
*(--bufpt) = cset[longvalue%base];
longvalue is defined as
UINT64_TYPE longvalue; /* Value for integer types */
and in this case, longvalue is 0. When I change the do .. while loop to a
while (longvalue > 0) .. it gets past this problem but then I get the error
"SQL logic error or missing database" further on down.
If I set -DVDBE_PROFILE=1 at compile time, I get the message "unknown opcode".
The code that I perform to reproduce in tcl is:
load /opt/centadm/builds/sqlite/bld/.libs/libtclsqlite3.sl
sqlite db :memory:
db eval "create table t1 (a,b);"
And at the sqlite prompt:
create table t1 (a,b);
Please let me know any other debugging output that would be helpful.
Thanks
Here is output from vdbe_profile.out:
----
770136623e623e676260153a165c2920072016321632627d15121a31214e206260151d6c16315c5c5c125c3c29777a20623e7827637b776e
0 0 0 0 Goto 0 52
0 0 0 1 ReadCookie 0 1
0 0 0 2 If 0 7
0 0 0 3 Integer 1 0
0 0 0 4 SetCookie 0 1
0 0 0 5 Integer 1 0
0 0 0 6 SetCookie 0 4
0 0 0 7 CreateTable 0 0
0 0 0 8 Integer 0 0
0 0 0 9 OpenWrite 0 1
0 0 0 10 SetNumColumns 0 5
0 0 0 11 NewRecno 0 0
0 0 0 12 Dup 0 0
0 0 0 13 String8 0 0
0 0 0 14 PutIntKey 0 0
0 0 0 15 Close 0 0
0 0 0 16 Pull 1 0
0 0 0 17 Close 0 0
0 0 0 18 Dup 0 0
0 0 0 19 MemStore 0 1
0 0 0 20 Dup 1 0
0 0 0 21 MemStore 1 1
0 0 0 22 Integer 0 0
0 0 0 23 OpenRead 0 1 # sqlite_master
0 0 0 24 SetNumColumns 0 5
0 0 0 25 MemLoad 1 0
0 0 0 26 MustBeInt 1 30
0 0 0 27 NotExists 0 30 pk
0 0 0 28 Recno 0 0
0 0 0 29 ListWrite 0 0
0 0 0 30 Close 0 0
0 0 0 31 Integer 0 0
0 0 0 32 OpenWrite 0 1
0 0 0 33 SetNumColumns 0 5
0 0 0 34 ListRewind 0 0
0 0 0 35 ListRead 0 46
0 0 0 36 Dup 0 0
0 0 0 37 NotExists 0 35
0 0 0 38 String8 0 0 table
0 0 0 39 String8 0 0 t1
0 0 0 40 String8 0 0 t1
0 0 0 41 MemLoad 0 0
0 0 0 42 String8 0 0 CREATE TABLE t1 (a,b)
0 0 0 43 MakeRecord 5 0 tttit
0 0 0 43 MakeRecord 5 0 tttit
0 0 0 44 PutIntKey 0 0
0 0 0 45 Goto 0 35
0 0 0 46 ListReset 0 0
0 0 0 47 Close 0 0
0 0 0 48 Integer 1 0
0 0 0 49 SetCookie 0 0
0 0 0 50 ParseSchema 0 0 tbl_name='t1'
0 0 0 51 Halt 0 0
0 0 0 52 Transaction 0 1
0 0 0 53 VerifyCookie 0 0
0 0 0 54 Goto 0 1
0 0 0 55 Noop 0 0