I can crash sqlite3 like this:

% cat test.sql
create table a (id INTEGER PRIMARY KEY);
alter table a add column f1 TEXT;
alter table a add column f2 TEXT;
alter table a add column f3 TEXT;
alter table a add column f4 TEXT;
alter table a add column f5 TEXT;
alter table a add column f6 TEXT;
alter table a add column f7 TEXT;
alter table a add column f8 TEXT;
alter table a add column f9 TEXT;
alter table a add column f10 TEXT;
alter table a add column f11 TEXT;
alter table a add column f12 TEXT;
alter table a add column f13 TEXT;
% sqlite3 foo2.db < test.sql
*** glibc detected *** double free or corruption (out): 0x00000000005136f0 ***
Aborted


The backtrace is:
#0 0x0000003aa212ec49 in raise () from /lib/tls/libc.so.6
#1 0x0000003aa213014e in abort () from /lib/tls/libc.so.6
#2 0x0000003aa2167b84 in malloc_usable_size () from /lib/tls/libc.so.6
#3 0x0000003aa2168646 in free () from /lib/tls/libc.so.6
#4 0x00002aaaaab0c55e in sqlite3FreeX (p=0x5146f0) at ./src/util.c:287
#5 0x00002aaaaaae3097 in sqliteResetColumnNames (pTable=0x512750) at ./src/build.c:397
#6 0x00002aaaaaae3174 in sqlite3DeleteTable (db=0x50b580, pTable=0x512750) at ./src/build.c:450
#7 0x00002aaaaab097ab in sqlite3RunParser (pParse=0x7fffffffdaa0, zSql=0x512720 "alter table a add column f9 TEXT;",
pzErrMsg=0x7fffffffda98) at ./src/tokenize.c:425
#8 0x00002aaaaaaf508e in sqlite3_prepare (db=0x50b580, zSql=0x512720 "alter table a add column f9 TEXT;", nBytes=-1,
ppStmt=0x7fffffffdc20, pzTail=0x7fffffffdc28) at ./src/main.c:1056
#9 0x00002aaaaab1e0c6 in sqlite3_exec (db=0x50b580, zSql=0x512720 "alter table a add column f9 TEXT;",
xCallback=0x402311 <callback>, pArg=0x7fffffffdd10, pzErrMsg=0x7fffffffdc90) at ./src/legacy.c:56
#10 0x0000000000405b16 in process_input (p=0x7fffffffdd10, in=0x3aa231fb60) at ./src/shell.c:1503
#11 0x000000000040657f in main (argc=2, argv=0x7ffffffff328) at ./src/shell.c:1795


This is sqlite 3.2.0, running on Gentoo amd64.

Should I submit a bug report?

Thanks,
Andy

Reply via email to