From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2237 Path: news.gmane.org!not-for-mail From: Paul Schutte Newsgroups: gmane.linux.lib.musl.general Subject: A few issues on MIPS Date: Mon, 5 Nov 2012 16:34:47 +0200 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d042dfcdb21304804cdc063aa X-Trace: ger.gmane.org 1352126103 9297 80.91.229.3 (5 Nov 2012 14:35:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2012 14:35:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2238-gllmg-musl=m.gmane.org@lists.openwall.com Mon Nov 05 15:35:12 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TVNle-0004uM-0Q for gllmg-musl@plane.gmane.org; Mon, 05 Nov 2012 15:35:10 +0100 Original-Received: (qmail 11976 invoked by uid 550); 5 Nov 2012 14:35:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11963 invoked from network); 5 Nov 2012 14:34:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=UPXIWJAkobKT4bEEvjsUnBR8WD3gtGaBR6uG4t2I9o8=; b=XStF1HFe2sH9w1UbzKL7jHhJPKp64m8k1n1SS2nt0iDrbBlDlrPG2mjgwuimFaJ7su JzHqhjnSDgUBgV4eULTZj31387S5tvQ05g3xp9YNZmYZq19PJ0045xQrvudqOC1aGdZp +JsGiiZoXsQXDrQMCQnissF3hI7IvDIaQggBce3YgCwgplNJR2/I4fDEuuab/2zTN+HV 8NSCy/A6ZDsuPp0Hwhbp79IttlINYN5L77anOiLhHhzNRE48zKeQ4nO2HsoaNd2vpReK J65q/Z+EJHuoIQ1aYtXRgZQxf3JhcU1TuYVqQr06k1OBPsZncLHKWonJuRlR8urFaXaF msbQ== Xref: news.gmane.org gmane.linux.lib.musl.general:2237 Archived-At: --f46d042dfcdb21304804cdc063aa Content-Type: text/plain; charset=ISO-8859-1 Hi Everyone, I am struggling to get sqlite3 and mongoose-3.3 to work on MIPS. I started out with a chroot environment based on aboriginal linux for MIPS where I replaced the default C-library from uclibc to musl as per the INSTALL instructions in the musl sources. I am using static linking. I can compile most things just fine and it is working ok, but I am having trouble with sqlite3 and mongoose. I am using http://sqlite.org/sqlite-autoconf-3071000.tar.gz It compiles without a problem, but when I run it, I get disk io errors (On both physical and virtual machines): root@tomato:/root# ./sqlite3 file SQLite version 3.7.10 2012-01-16 13:28:40 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .schema Error: disk I/O error sqlite> This is the strace that I get: execve("./sqlite3", ["./sqlite3", "file"], [/* 28 vars */]) = 0 ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0 rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 16) = 0 set_thread_area(0x4c9b14) = 0 set_tid_address(0x4c2a84) = 16812 rt_sigaction(SIGINT, {0x14000000, [RT_68 RT_69 RT_70 RT_72 RT_78 RT_82 RT_84 RT_87], 0x407190 /* SA_??? */}, {SIG_DFL, [RT_68 RT_69 RT_70 RT_72 RT_78 RT_82 RT_84 RT_87], 0}, 16) = 0 access("file", F_OK) = 0 brk(0) = 0x4c3000 brk(0x4c4000) = 0x4c4000 getcwd("/root", 512) = 6 stat64("/root/file", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 open("/root/file", O_RDWR|O_CREAT|O_LARGEFILE, 0644) = 3 fcntl64(3, F_GETFD) = 0 fcntl64(3, F_SETFD, FD_CLOEXEC) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 _llseek(3, 0, [0], SEEK_SET) = 0 read(3, "", 100) = 0 brk(0x4c5000) = 0x4c5000 brk(0x4d5000) = 0x4d5000 getuid() = 0 open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 readv(4, [{"", 0}, {"root::0:0:root:/home/root:/bin/s"..., 1024}], 2) = 76 _llseek(4, -42, [34], SEEK_CUR) = 0 close(4) = 0 open("/home/root/.sqliterc", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0 writev(1, [{"SQLite version 3.7.10 2012-01-16"..., 41}, {"\nEnter \".help\" for instructions\n"..., 75}], 2SQLite version 3.7.10 2012-01-16 13:28:40 Enter ".help" for instructions Enter SQL statements terminated with a ";" ) = 116 getuid() = 0 open("/etc/passwd", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 4 fcntl64(4, F_SETFD, FD_CLOEXEC) = 0 readv(4, [{"", 0}, {"root::0:0:root:/home/root:/bin/s"..., 1024}], 2) = 76 _llseek(4, -42, [34], SEEK_CUR) = 0 close(4) = 0 writev(1, [{"sqlite> ", 8}, {NULL, 0}], 2sqlite> ) = 8 readv(0, [{"", 0}, {".schema\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024}], 2) = 8 brk(0x4d6000) = 0x4d6000 fcntl64(3, 0xd /* F_??? */, 0x7fc84210) = -1 EINVAL (Invalid argument) writev(2, [{"Error: disk I/O error\n", 22}, {NULL, 0}], 2Error: disk I/O error ) = 22 writev(1, [{"sqlite> ", 8}, {NULL, 0}], 2sqlite> ) = 8 When using uclibc I do not get the error: -- snip -- write(1, "SQLite version 3.7.10 2012-01-16"..., 116SQLite version 3.7.10 2012-01-16 13:28:40 Enter ".help" for instructions Enter SQL statements terminated with a ";" ) = 116 getuid() = 0 open("/etc/passwd", O_RDONLY) = 4 ioctl(4, TIOCNXCL, 0x7ff2aee0) = -1 ENOTTY (Inappropriate ioctl for device) read(4, "root::0:0:root:/home/root:/bin/s"..., 4096) = 76 close(4) = 0 write(1, "sqlite> ", 8sqlite> ) = 8 read(0,".schema\n", 4096) = 8 brk(0x6d1000) = 0x6d1000 fcntl64(3, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0x7ff28fd0) = 0 fcntl64(3, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0x7ff28fd0) = 0 fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0x7ff28fd0) = 0 access("/home/sqlite-autoconf-3071000/file-journal", F_OK) = -1 ENOENT (No such file or directory) fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 unlink("/home/sqlite-autoconf-3071000/file-wal") = -1 ENOENT (No such file or directory) fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 brk(0x6d2000) = 0x6d2000 fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0x7ff28aa0) = 0 brk(0x6d3000) = 0x6d3000 fcntl64(3, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}, 0x7ff29250) = 0 fcntl64(3, F_SETLK64, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}, 0x7ff29250) = 0 fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}, 0x7ff29250) = 0 access("/home/sqlite-autoconf-3071000/file-journal", F_OK) = -1 ENOENT (No such file or directory) fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 unlink("/home/sqlite-autoconf-3071000/file-wal") = -1 ENOENT (No such file or directory) fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 brk(0x6d4000) = 0x6d4000 fcntl64(3, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0x7ff29250) = 0 write(1, "sqlite> ", 8sqlite> ) = 8 If I compile it on amd64/i386 using musl and the same procedure, I also do not get the problem. -- snip -- writev(1, [{"SQLite version 3.7.10 2012-01-16"..., 41}, {"\nEnter \".help\" for instructions\n"..., 75}], 2SQLite version 3.7.10 2012-01-16 13:28:40 Enter ".help" for instructions Enter SQL statements terminated with a ";" ) = 116 getuid() = 1000 open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 4 brk(0x1d40000) = 0x1d40000 fcntl(4, F_SETFD, FD_CLOEXEC) = 0 readv(4, [{"", 0}, {"root:x:0:0:root:/root:/bin/bash\n"..., 1024}], 2) = 1024 readv(4, [{"", 0}, {"/lib/avahi-autoipd:/bin/false\nav"..., 1024}], 2) = 891 lseek(4, -187, SEEK_CUR) = 1728 close(4) = 0 writev(1, [{"sqlite> ", 8}, {NULL, 0}], 2sqlite> ) = 8 readv(0, [{"", 0}, {".schema\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024}], 2) = 8 brk(0x1d41000) = 0x1d41000 fcntl(3, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0 fcntl(3, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0 access("/home/paul/Downloads/sqlite-autoconf-3071000/file-journal", F_OK) = -1 ENOENT (No such file or directory) fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 unlink("/home/paul/Downloads/sqlite-autoconf-3071000/file-wal") = -1 ENOENT (No such file or directory) fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 brk(0x1d42000) = 0x1d42000 brk(0x1d43000) = 0x1d43000 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0 brk(0x1d44000) = 0x1d44000 fcntl(3, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0 fcntl(3, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0 access("/home/paul/Downloads/sqlite-autoconf-3071000/file-journal", F_OK) = -1 ENOENT (No such file or directory) fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 unlink("/home/paul/Downloads/sqlite-autoconf-3071000/file-wal") = -1 ENOENT (No such file or directory) fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 brk(0x1d45000) = 0x1d45000 fcntl(3, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0 writev(1, [{"sqlite> ", 8}, {NULL, 0}], 2sqlite> ) = 8 I have setup a cross compile environment according to http://cmer.uoguelph.ca/apklinux/, which work very well, but give the same result. I also tried this in the MIPS aboriginal image virtual machine, instead of the physical hardware. I still get the same issue. I also statically compiled mongoose-3.3 and get a different problem there. (Port 8080 is available): execve("./mongoose", ["./mongoose"], [/* 28 vars */]) = 0 open("./mongoose.conf", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory) rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 16) = 0 set_thread_area(0x448974) = 0 set_tid_address(0x4418e4) = 16807 rt_sigaction(SIGTERM, {0x14000000, [RT_68 RT_69 RT_71 RT_72 RT_80 RT_82 RT_87], 0x4002f0 /* SA_??? */}, {SIG_DFL, [RT_68 RT_69 RT_71 RT_72 RT_80 RT_82 RT_87], 0}, 16) = 0 rt_sigaction(SIGINT, {0x14000000, [RT_68 RT_69 RT_71 RT_72 RT_80 RT_82 RT_87], 0x4002f0 /* SA_??? */}, {SIG_DFL, [RT_68 RT_69 RT_71 RT_72 RT_80 RT_82 RT_87], 0}, 16) = 0 brk(0) = 0x442000 brk(0x443000) = 0x443000 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3 setsockopt(3, SO_DEBUG, 2, [1], 4) = -1 ENOPROTOOPT (Protocol not available) close(3) = 0 ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0 writev(1, [{"set_ports_option: cannot bind to"..., 70}, {"\n", 1}], 2set_ports_option: cannot bind to 8080: Cannot assign requested address ) = 71 writev(2, [{"Failed to start Mongoose.\n", 26}, {NULL, 0}], 2Failed to start Mongoose. ) = 26 exit_group(1) = ? +++ exited with 1 +++ On a different architecture (amd64) it works: execve("./mongoose", ["./mongoose"], [/* 39 vars */]) = 0 rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) = 0 arch_prctl(ARCH_SET_FS, 0x621960) = 0 set_tid_address(0x621990) = 9789 open("./mongoose.conf", O_RDONLY) = -1 ENOENT (No such file or directory) rt_sigaction(SIGTERM, {0x4001f4, [], SA_RESTORER|SA_RESTART, 0x418ea8}, {SIG_DFL, [], 0}, 8) = 0 rt_sigaction(SIGINT, {0x4001f4, [], SA_RESTORER|SA_RESTART, 0x418ea8}, {SIG_DFL, [], 0}, 8) = 0 brk(0) = 0x1aab000 brk(0x1aac000) = 0x1aac000 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0 bind(3, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("0.0.0.0")}, 16) = 0 listen(3, 128) = 0 fcntl(3, F_SETFD, FD_CLOEXEC) = 0 Just for completeness this is the MIPS hardware: root@tomato:/root# cat /proc/version Linux version 2.6.22.19 (root@tomato) (gcc version 4.2.4) #21 Sat Sep 1 04:19:40 CEST 2012 root@tomato:/root# cat /proc/cpuinfo system type : Broadcom BCM4716 chip rev 1 pkg 10 processor : 0 cpu model : MIPS 74K V4.0 BogoMIPS : 239.20 cpu MHz : 480 wait instruction : no microsecond timers : yes tlb_entries : 64 extra interrupt vector : no hardware watchpoint : yes ASEs implemented : mips16 dsp shadow register sets : 1 VCED exceptions : not available VCEI exceptions : not available unaligned_instructions : 12 root@tomato:/root# This is the qemu aboriginal linux image info: (mipsel:1) /home # cat /proc/version Linux version 3.5.0 (landley@brillig) (libc/sysdeps/linux/mips/crt1.S:(.text+0x1c): undefined reference to `main') #1 Thu Aug 23 02:33:15 CDT 2012 (mipsel:1) /home # cat /proc/cpuinfo system type : MIPS Malta processor : 0 cpu model : MIPS 24Kc V0.0 FPU V0.0 BogoMIPS : 1179.64 wait instruction : yes microsecond timers : yes tlb_entries : 16 extra interrupt vector : yes hardware watchpoint : yes, count: 1, address/irw mask: [0x0ff8] ASEs implemented : mips16 shadow register sets : 1 kscratch registers : 0 core : 0 VCED exceptions : not available VCEI exceptions : not available It is quite likely that I messed up, but if have tried several different ways on both physical and virtual machines, with native and cross compiling. I get the same result every time. BTW I have compiled LuaJit statically using the same method and it works fine. (I can run scimark.lua). Regards Paul --f46d042dfcdb21304804cdc063aa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Everyone,

I am struggling to get sqlite3 and mongoose-3.3 to work= on MIPS.
I started out with a chroot environment based on aboriginal l= inux for MIPS where I replaced the default C-library from uclibc to musl as= per the INSTALL instructions in the musl sources. I am using static linkin= g.

I can compile most things just fine and it is working ok, but I am havi= ng trouble with sqlite3 and mongoose.
I am using http://sqlite.org/sqlite-autoconf-307= 1000.tar.gz
It compiles without a problem, but when I run it, I get disk io errors (On = both physical and virtual machines):

root@tomato:/root# ./sqlite3 fi= le
SQLite version 3.7.10 2012-01-16 13:28:40
Enter ".help" = for instructions
Enter SQL statements terminated with a ";"
sqlite> .schema<= br>Error: disk I/O error
sqlite>

This is the strace that I ge= t:

execve("./sqlite3", ["./sqlite3", "file&= quot;], [/* 28 vars */]) =3D 0
ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) =3D 0
rt_sigproc= mask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 16) =3D 0
set_thread_area(0x4c9b14)= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
set_tid_address(0x4c2a8= 4)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 16812
rt_sigaction(SIGI= NT, {0x14000000, [RT_68 RT_69 RT_70 RT_72 RT_78 RT_82 RT_84 RT_87], 0x40719= 0 /* SA_??? */}, {SIG_DFL, [RT_68 RT_69 RT_70 RT_72 RT_78 RT_82 RT_84 RT_87= ], 0}, 16) =3D 0
access("file", F_OK)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 =3D 0
brk(0)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x4c3000
brk(= 0x4c4000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 =3D 0x4c4000
getcwd("/root", 512)=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 6
stat64("/root/file", {st_mode=3DS_IFREG|0644, st_size=3D0, ...}) = =3D 0
open("/root/file", O_RDWR|O_CREAT|O_LARGEFILE, 0644) =3D= 3
fcntl64(3, F_GETFD)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 =3D 0
fcntl64(3, F_SETFD, FD_CLOEXEC)=A0=A0=A0=A0=A0=A0=A0= =A0 =3D 0
fstat64(3, {st_mode=3DS_IFREG|0644, st_size=3D0, ...}) =3D 0
_llseek(3, = 0, [0], SEEK_SET)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
read(3, "&= quot;, 100)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 =3D 0
brk(0x4c5000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x4c5000
brk(0x4d5000)=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x4d= 5000
getuid()=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
open("/etc/passwd", O_RDONLY= |O_LARGEFILE|O_CLOEXEC) =3D 4
fcntl64(4, F_SETFD, FD_CLOEXEC)=A0=A0=A0= =A0=A0=A0=A0=A0 =3D 0
readv(4, [{"", 0}, {"root::0:0:root= :/home/root:/bin/s"..., 1024}], 2) =3D 76
_llseek(4, -42, [34], SEEK_CUR)=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
close(4)= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 =3D 0
open("/home/root/.sqliterc", O_RDONLY= |O_LARGEFILE) =3D -1 ENOENT (No such file or directory)
ioctl(1, TIOCNXC= L, {B38400 opost isig icanon echo ...}) =3D 0
writev(1, [{"SQLite version 3.7.10 2012-01-16"..., 41}, {"\n= Enter \".help\" for instructions\n"..., 75}], 2SQLite versio= n 3.7.10 2012-01-16 13:28:40
Enter ".help" for instructions Enter SQL statements terminated with a ";"
) =3D 116
getuid= ()=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 =3D 0
open("/etc/passwd", O_RDONLY|O_LAR= GEFILE|O_CLOEXEC) =3D 4
fcntl64(4, F_SETFD, FD_CLOEXEC)=A0=A0=A0=A0=A0= =A0=A0=A0 =3D 0
readv(4, [{"", 0}, {"root::0:0:root:/home/root:/bin/s".= .., 1024}], 2) =3D 76
_llseek(4, -42, [34], SEEK_CUR)=A0=A0=A0=A0=A0=A0= =A0=A0 =3D 0
close(4)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
writev(1, [{"sqlit= e> ", 8}, {NULL, 0}], 2sqlite> ) =3D 8
readv(0, [{"", 0}, {".schema\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0= \0\0\0\0\0\0\0\0\0"..., 1024}], 2) =3D 8
brk(0x4d6000)=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x4d= 6000
fcntl64(3, 0xd /* F_??? */, 0x7fc84210) =3D -1 EINVAL (Invalid argu= ment)
writev(2, [{"Error: disk I/O error\n", 22}, {NULL, 0}], 2Error: d= isk I/O error
) =3D 22
writev(1, [{"sqlite> ", 8}, {NULL= , 0}], 2sqlite> ) =3D 8


When using uclibc I do not get the er= ror:

-- snip --
write(1, "SQLite version 3.7.10 2012-01-16"...,= 116SQLite version 3.7.10 2012-01-16 13:28:40
Enter ".help" fo= r instructions
Enter SQL statements terminated with a ";"
) =3D 116
getuid()=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
open("/etc/passwd&quo= t;, O_RDONLY)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 4
ioctl(4, TIOCNXCL, 0x7= ff2aee0)=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D -1 ENOTTY (Inappropriate ioctl for = device)
read(4, "root::0:0:root:/home/root:/bin/s"..., 4096) = =3D 76
close(4)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
write(1, "sqlite> ", 8sql= ite> )=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 8
read(0,&= quot;.schema\n", 4096)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 8brk(0x6d1000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 =3D 0x6d1000
fcntl64(3, F_SETLK64, {type=3DF_RDLCK, whence=3DSEEK_SET, start=3D107374182= 4, len=3D1}, 0x7ff28fd0) =3D 0
fcntl64(3, F_SETLK64, {type=3DF_RDLCK, wh= ence=3DSEEK_SET, start=3D1073741826, len=3D510}, 0x7ff28fd0) =3D 0
fcntl= 64(3, F_SETLK64, {type=3DF_UNLCK, whence=3DSEEK_SET, start=3D1073741824, le= n=3D1}, 0x7ff28fd0) =3D 0
access("/home/sqlite-autoconf-3071000/file-journal", F_OK) =3D -1= ENOENT (No such file or directory)
fstat64(3, {st_mode=3DS_IFREG|0644, = st_size=3D0, ...}) =3D 0
unlink("/home/sqlite-autoconf-3071000/file= -wal") =3D -1 ENOENT (No such file or directory)
fstat64(3, {st_mode=3DS_IFREG|0644, st_size=3D0, ...}) =3D 0
brk(0x6d200= 0)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 =3D 0x6d2000
fcntl64(3, F_SETLK64, {type=3DF_UNLCK, whence=3DSEEK= _SET, start=3D0, len=3D0}, 0x7ff28aa0) =3D 0
brk(0x6d3000)=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x6d= 3000
fcntl64(3, F_SETLK64, {type=3DF_RDLCK, whence=3DSEEK_SET, start=3D107374182= 4, len=3D1}, 0x7ff29250) =3D 0
fcntl64(3, F_SETLK64, {type=3DF_RDLCK, wh= ence=3DSEEK_SET, start=3D1073741826, len=3D510}, 0x7ff29250) =3D 0
fcntl= 64(3, F_SETLK64, {type=3DF_UNLCK, whence=3DSEEK_SET, start=3D1073741824, le= n=3D1}, 0x7ff29250) =3D 0
access("/home/sqlite-autoconf-3071000/file-journal", F_OK) =3D -1= ENOENT (No such file or directory)
fstat64(3, {st_mode=3DS_IFREG|0644, = st_size=3D0, ...}) =3D 0
fstat64(3, {st_mode=3DS_IFREG|0644, st_size=3D0= , ...}) =3D 0
unlink("/home/sqlite-autoconf-3071000/file-wal") =3D -1 ENOENT (N= o such file or directory)
fstat64(3, {st_mode=3DS_IFREG|0644, st_size=3D= 0, ...}) =3D 0
brk(0x6d4000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x6d4000
fcntl64(3, F_SETLK64, = {type=3DF_UNLCK, whence=3DSEEK_SET, start=3D0, len=3D0}, 0x7ff29250) =3D 0<= br> write(1, "sqlite> ", 8sqlite> )=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 =3D 8

If I compile it on amd64/i386 using musl= and the same procedure, I also do not get the problem.

-- snip --writev(1, [{"SQLite version 3.7.10 2012-01-16"..., 41}, {"= \nEnter \".help\" for instructions\n"..., 75}], 2SQLite vers= ion 3.7.10 2012-01-16 13:28:40
Enter ".help" for instructions
Enter SQL statements terminated= with a ";"
) =3D 116
getuid()=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 1000=
open("/etc/passwd", O_RDONLY|O_CLOEXEC) =3D 4
brk(0x1d4000= 0)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 =3D 0x1d40000
fcntl(4, F_SETFD, FD_CLOEXEC)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
readv(= 4, [{"", 0}, {"root:x:0:0:root:/root:/bin/bash\n"..., 1= 024}], 2) =3D 1024
readv(4, [{"", 0}, {"/lib/avahi-autoip= d:/bin/false\nav"..., 1024}], 2) =3D 891
lseek(4, -187, SEEK_CUR)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 1= 728
close(4)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
writev(1, [{"sqlite> &qu= ot;, 8}, {NULL, 0}], 2sqlite> ) =3D 8
readv(0, [{"", 0}, {&= quot;.schema\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 10= 24}], 2) =3D 8
brk(0x1d41000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 =3D 0x1d41000
fcntl(3, F_SETLK, {type=3DF_RDLCK, whence= =3DSEEK_SET, start=3D1073741824, len=3D1}) =3D 0
fcntl(3, F_SETLK, {type= =3DF_RDLCK, whence=3DSEEK_SET, start=3D1073741826, len=3D510}) =3D 0
fcntl(3, F_SETLK, {type=3DF_UNLCK, whence=3DSEEK_SET, start=3D1073741824, l= en=3D1}) =3D 0
access("/home/paul/Downloads/sqlite-autoconf-3071000= /file-journal", F_OK) =3D -1 ENOENT (No such file or directory)
fst= at(3, {st_mode=3DS_IFREG|0644, st_size=3D0, ...}) =3D 0
unlink("/home/paul/Downloads/sqlite-autoconf-3071000/file-wal") = =3D -1 ENOENT (No such file or directory)
fstat(3, {st_mode=3DS_IFREG|06= 44, st_size=3D0, ...}) =3D 0
brk(0x1d42000)=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x1d42000
brk(0x1d43000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 =3D 0x1d43000
fcntl(3, F_SETLK, {type=3DF_UNLCK, whence= =3DSEEK_SET, start=3D0, len=3D0}) =3D 0
brk(0x1d44000)=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x1d44000
= fcntl(3, F_SETLK, {type=3DF_RDLCK, whence=3DSEEK_SET, start=3D1073741824, l= en=3D1}) =3D 0
fcntl(3, F_SETLK, {type=3DF_RDLCK, whence=3DSEEK_SET, start=3D1073741826, l= en=3D510}) =3D 0
fcntl(3, F_SETLK, {type=3DF_UNLCK, whence=3DSEEK_SET, s= tart=3D1073741824, len=3D1}) =3D 0
access("/home/paul/Downloads/sql= ite-autoconf-3071000/file-journal", F_OK) =3D -1 ENOENT (No such file = or directory)
fstat(3, {st_mode=3DS_IFREG|0644, st_size=3D0, ...}) =3D 0
fstat(3, {st_= mode=3DS_IFREG|0644, st_size=3D0, ...}) =3D 0
unlink("/home/paul/Do= wnloads/sqlite-autoconf-3071000/file-wal") =3D -1 ENOENT (No such file= or directory)
fstat(3, {st_mode=3DS_IFREG|0644, st_size=3D0, ...}) =3D 0
brk(0x1d45000= )=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 =3D 0x1d45000
fcntl(3, F_SETLK, {type=3DF_UNLCK, whence=3DSEEK_SET, = start=3D0, len=3D0}) =3D 0
writev(1, [{"sqlite> ", 8}, {NUL= L, 0}], 2sqlite> ) =3D 8


I have setup a cross compile environment according to=20 http://cmer.uoguelph.ca/apkli= nux/, which work very well, but give the=20 same result. I also tried this in the MIPS aboriginal image virtual machine= , instead of the physical hardware. I still get the same issue.


= I also statically compiled mongoose-3.3 and get a different problem there. = (Port 8080 is available):


execve("./mongoose", ["./mongoose"], [/* 28 var= s */]) =3D 0
open("./mongoose.conf", O_RDONLY|O_LARGEFILE) =3D= -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_UNBLOCK, [RT_1= RT_2], NULL, 16) =3D 0
set_thread_area(0x448974)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0set_tid_address(0x4418e4)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 1= 6807
rt_sigaction(SIGTERM, {0x14000000, [RT_68 RT_69 RT_71 RT_72 RT_80 R= T_82 RT_87], 0x4002f0 /* SA_??? */}, {SIG_DFL, [RT_68 RT_69 RT_71 RT_72 RT_= 80 RT_82 RT_87], 0}, 16) =3D 0
rt_sigaction(SIGINT, {0x14000000, [RT_68 RT_69 RT_71 RT_72 RT_80 RT_82 RT_8= 7], 0x4002f0 /* SA_??? */}, {SIG_DFL, [RT_68 RT_69 RT_71 RT_72 RT_80 RT_82 = RT_87], 0}, 16) =3D 0
brk(0)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x442000
brk(0x443000)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 =3D 0x443000
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP= ) =3D 3
setsockopt(3, SO_DEBUG, 2, [1], 4)=A0=A0=A0=A0=A0 =3D -1 ENOPROT= OOPT (Protocol not available)
close(3)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) =3D 0
writev(1, = [{"set_ports_option: cannot bind to"..., 70}, {"\n", 1}= ], 2set_ports_option: cannot bind to 8080: Cannot assign requested address<= br> ) =3D 71
writev(2, [{"Failed to start Mongoose.\n", 26}, {NULL= , 0}], 2Failed to start Mongoose.
) =3D 26
exit_group(1)=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D ?+++ exited with 1 +++

On a different architecture (amd64) it works:=

execve("./mongoose", ["./mongoose"], [/* 39 vars */= ]) =3D 0
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 8) =3D 0
arch= _prctl(ARCH_SET_FS, 0x621960)=A0=A0=A0=A0=A0=A0 =3D 0
set_tid_address(0x= 621990)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 9789
open("./mongoose.conf", O_RDONLY)=A0=A0=A0=A0=A0=A0 =3D -1 ENOENT= (No such file or directory)
rt_sigaction(SIGTERM, {0x4001f4, [], SA_RES= TORER|SA_RESTART, 0x418ea8}, {SIG_DFL, [], 0}, 8) =3D 0
rt_sigaction(SIG= INT, {0x4001f4, [], SA_RESTORER|SA_RESTART, 0x418ea8}, {SIG_DFL, [], 0}, 8)= =3D 0
brk(0)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x1aab000
brk(0x1aac000)=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0x1aac0= 00
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) =3D 3
setsockopt(3, SOL_= SOCKET, SO_REUSEADDR, [1], 4) =3D 0
setsockopt(3, SOL_SOCKET, SO_KEEPALI= VE, [1], 4) =3D 0
bind(3, {sa_family=3DAF_INET, sin_port=3Dhtons(8080), sin_addr=3Dinet_addr(= "0.0.0.0")}, 16) =3D 0
listen(3, 128)=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0
fcntl(3, F_SET= FD, FD_CLOEXEC)=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =3D 0


Just for com= pleteness this is the MIPS hardware:
root@tomato:/root# cat /proc/version
Linux version 2.6.22.19 (root@toma= to) (gcc version 4.2.4) #21 Sat Sep 1 04:19:40 CEST 2012

root@tomato= :/root# cat /proc/cpuinfo
system type=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 : Broadcom BCM4716 chip rev 1 pkg 10
processor=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 : 0
cpu model=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 : MIPS 74K V4.0
BogoMIPS=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 : 239.20
cpu MHz=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 : 480
wait instruction=A0=A0=A0=A0=A0=A0= =A0 : no
microsecond timers=A0=A0=A0=A0=A0 : yes
tlb_entries=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 : 64
extra interrupt vector=A0 : no
hardware watchpoint=A0=A0=A0=A0 : yes
= ASEs implemented=A0=A0=A0=A0=A0=A0=A0 : mips16 dsp
shadow register sets= =A0=A0=A0 : 1
VCED exceptions=A0=A0=A0=A0=A0=A0=A0=A0 : not availableVCEI exceptions=A0=A0=A0=A0=A0=A0=A0=A0 : not available

unaligned_instructions=A0 : 12
root@tomato:/root#


This i= s the qemu aboriginal linux image info:
(mipsel:1) /home # cat /proc/ver= sion
Linux version 3.5.0 (landley@brillig) (libc/sysdeps/linux/mips/crt= 1.S:(.text+0x1c): undefined reference to `main') #1 Thu Aug 23 02:33:15= CDT 2012

(mipsel:1) /home # cat /proc/cpuinfo
system type=A0=A0=A0 =A0=A0=A0= : MIPS Malta
processor=A0=A0=A0 =A0=A0=A0 : 0
cpu model=A0=A0=A0 =A0= =A0=A0 : MIPS 24Kc V0.0=A0 FPU V0.0
BogoMIPS=A0=A0=A0 =A0=A0=A0 : 1179.6= 4
wait instruction=A0=A0=A0 : yes
microsecond timers=A0=A0=A0 : yes tlb_entries=A0=A0=A0 =A0=A0=A0 : 16
extra interrupt vector=A0=A0=A0 : ye= s
hardware watchpoint=A0=A0=A0 : yes, count: 1, address/irw mask: [0x0ff= 8]
ASEs implemented=A0=A0=A0 : mips16
shadow register sets=A0=A0=A0 := 1
kscratch registers=A0=A0=A0 : 0
core=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 : 0
VCED exceptions=A0=A0=A0 =A0=A0=A0= : not available
VCEI exceptions=A0=A0=A0 =A0=A0=A0 : not available
<= br>
It is quite likely that I messed up, but if have tried several diffe= rent ways on both physical and virtual machines, with native and cross comp= iling. I get the same result every time. BTW I have compiled LuaJit statica= lly using the same method and it works fine. (I can run scimark.lua).

Regards
Paul
--f46d042dfcdb21304804cdc063aa--