Hi all, I've an out of memory error with the sqlite3 (3.6.10) shell and a very small database, in an uclinux embedded system (m68k arch).
With strace the problem is clear: sqlite3 calls "old_mmap" with length=0. I'm running version 2.6.25-uc0 of uCLinux, so mmap returns EINVAL because length==0, then sqlite3 says "out of memory". The funny part is that I'm unable to get the error if the database file is in a NFS mounted filesystem, but I always get the error with the file in a local jffs2 filesystem. What can I do to solve this problem? I send you attached both strace logs. Regards, Roberto Lumbreras
117 execve("/nfs/sqlite3", ["/nfs/sqlite3", "/flash/config.db"], [/* 8 vars */]) = 0 117 ioctl(0, SNDCTL_TMR_TIMEBASE, {B9600 opost isig icanon echo ...}) = 0 117 ioctl(1, SNDCTL_TMR_TIMEBASE, {B9600 opost isig icanon echo ...}) = 0 117 ioctl(0, SNDCTL_TMR_TIMEBASE, {B9600 opost isig icanon echo ...}) = 0 117 rt_sigaction(SIGINT, {b833a6, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0 117 access("/flash/config.db", F_OK) = 0 117 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0) = fc7000 117 open("/flash/config.db", O_RDWR|O_CREAT|O_LARGEFILE, 0644) = 3 117 fcntl(3, F_GETFD) = 0 117 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 117 fstat(3, {st_mode=S_IFREG|0644, st_size=46080, ...}) = 0 117 lseek(3, 0, SEEK_SET) = 0 117 read(3, "SQLite format 3\0\4\0\1\1\0@ \0\0\0\3\0\0\0\0"..., 100) = 100 117 old_mmap(NULL, 53248, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0) = 3d0000 117 old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0) = 524000 117 getuid32() = 0 117 open("/etc/passwd", O_RDONLY) = 4 117 ioctl(4, SNDCTL_TMR_TIMEBASE, 42e810) = -1 ENOTTY (Not a typewriter) 117 old_mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0) = 4ee000 117 read(4, "root:*:0:0:Administr"..., 4096) = 71 117 close(4) = 0 117 open("//.sqliterc", O_RDONLY) = -1 ENOENT (No such file or directory) 117 write(1, "SQLite version 3.6.10\nEnter \".he"..., 96) = 96 117 getuid32() = 0 117 open("/etc/passwd", O_RDONLY) = 4 117 ioctl(4, SNDCTL_TMR_TIMEBASE, 42e808) = -1 ENOTTY (Not a typewriter) 117 read(4, "root:*:0:0:Administr"..., 4096) = 71 117 close(4) = 0 117 write(1, "sqlite> ", 8) = 8 117 read(0, "select * from actors;\n", 4096) = 22 117 fcntl(3, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0 117 fcntl(3, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0 117 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0 117 access("/flash/config.db-journal", F_OK) = -1 ENOENT (No such file or directory) 117 fstat(3, {st_mode=S_IFREG|0644, st_size=46080, ...}) = 0 117 lseek(3, 0, SEEK_SET) = 0 117 read(3, "SQLite format 3\0\4\0\1\1\0@ \0\0\0\3\0\0\0\0"..., 1024) = 1024 117 lseek(3, 7168, SEEK_SET) = 7168 117 read(3, "\r\0\0\0\5\0\0\0\1t\001Æ\2\3Z\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024 117 old_mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, 0, 0) = -1 EINVAL (Invalid argument) 117 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0 117 write(1, "SQL error: out of memory\n", 25) = 25 117 write(1, "sqlite> ", 8) = 8 117 read(0, "", 4096) = 0 117 close(3) = 0 117 --- SIGILL (Illegal instruction) --- 117 +++ killed by SIGILL +++
_______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users