Hi,

I am running Scratchbox 1.0.16 on xubuntu 9.10 (Karmic). I followed the
tips to set the tunables as described here:

http://inz.fi/blog/2008/01/17/scratchbox-on-hardy/

Scratxchox target settings:

Compiler: arm-linux-cs2008q3-72
Devkits: debian-sarge maemo3-tools doctools perl qemu maemo3-debian
CPU-transparency: /scratchbox/devkits/qemu/bin/qemu-arm-sb

Compiling and executing binaries for armel worked fine until the latest
update of the Linux kernel to 2.6.31-rc7.

$ uname -a
Linux vm-xubuntu 2.6.31-7-generic #27-Ubuntu SMP Mon Aug 24 17:33:49 UTC
2009 i686 GNU/Linux

Execution of the simplest possible C program fails:

int main(int argc, const char *argv)
{
        return 0;
}

$ ./empty 
mmap: Permission denied

Changing the tunables to any value doesn't solve the problem.

/proc/sys/vm/mmap_min_addr  --> 0
/proc/sys/vm/vdso_enabled   --> 0

$ /scratchbox/devkits/qemu/bin/qemu-arm-sb -v                 
qemu-arm version 0.10.0, Copyright (c) 2003-2008 Fabrice Bellard

$ strace ./empty

execve("./empty", ["./empty"], [/* 51 vars */]) = 0
uname({sys="Linux", node="vm-xubuntu", ...}) = 0
brk(0)                                  = 0x92ef000
brk(0x9310000)                          = 0x9310000
open("/targets/links/scratchbox.config", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0664, st_size=1187, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40000000
read(3, "# Automatically generated config"..., 4096) = 1187
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40000000, 4096)                = 0
open("/tmp/cputransp_matejk.log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
fstat64(3, {st_mode=S_IFREG|0664, st_size=78376, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40001000
fstat64(3, {st_mode=S_IFREG|0664, st_size=78376, ...}) = 0
_llseek(3, 78376, [78376], SEEK_SET)    = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/home/matejk", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
gettimeofday({1251289859, 275446}, NULL) = 0
open("/scratchbox/etc/localtime", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=1931, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40002000
read(4, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0\0"..., 4096) = 
1931
close(4)                                = 0
munmap(0x40002000, 4096)                = 0
getpid()                                = 15343
open("/scratchbox/etc/scratchbox-version", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=39, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40000000
read(4, "1.0.16\nMon, 24 Aug 2009 15:03:02"..., 4096) = 39
close(4)                                = 0
munmap(0x40000000, 4096)                = 0
open("./empty", O_RDONLY)               = 4
fstat64(4, {st_mode=S_IFREG|0775, st_size=4925, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40002000
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\2\0(\0\1\0\0\0\224\202"..., 4096) = 
4096
close(4)                                = 0
munmap(0x40002000, 4096)                = 0
write(3, "[2009-08-26 12:30:59 15343] meth"..., 124) = 124
rt_sigaction(SIGCHLD, {0x8048d40, [], SA_RESTORER, 0x8049b48}, NULL, 8) = 0
rt_sigaction(SIGTERM, {0x8048d50, [], SA_RESTORER, 0x8049b48}, NULL, 8) = 0
rt_sigaction(SIGHUP, {0x8048d50, [], SA_RESTORER, 0x8049b48}, NULL, 8) = 0
rt_sigaction(SIGINT, {0x8048d50, [], SA_RESTORER, 0x8049b48}, NULL, 8) = 0
fork()                                  = 15344
mmap: Permission denied
waitpid(15344, [{WIFEXITED(s) && WEXITSTATUS(s) == 255}], 0) = 15344
--- SIGCHLD (Child exited) @ 0 (0) ---
sigreturn()                             = ? (mask now [RTMIN])
gettimeofday({1251289859, 298921}, NULL) = 0
getpid()                                = 15343
write(3, "[2009-08-26 12:30:59 15343] rc: "..., 52) = 52
munmap(0x40001000, 4096)                = 0
exit_group(255)                         = ?

I managed to execute the program by invoking qemu directly:

$ /scratchbox/devkits/qemu/bin/qemu-arm-sb -B 0x100000 ./empty
15382 brk(0,1073373184,-512,-512,1073373184,1073372672) = 0x00011000
15382 uname(0x3ff7ebf2) = 0
15382 access("/etc/ld.so.preload",04) = -1 errno=2 (No such file or directory)
15382 open("/lib/tls/fast-mult/half/libc.so.6",0,07776463300) = -1 errno=2 (No 
such file or directory)
15382 stat64("/lib/tls/fast-mult/half",0x3ff7e7f8) = -1 errno=2 (No such file 
or directory)
15382 open("/lib/tls/fast-mult/libc.so.6",0,07776463300) = -1 errno=2 (No such 
file or directory)
15382 stat64("/lib/tls/fast-mult",0x3ff7e7f8) = -1 errno=2 (No such file or 
directory)
15382 open("/lib/tls/half/libc.so.6",0,07776463300) = -1 errno=2 (No such file 
or directory)
15382 stat64("/lib/tls/half",0x3ff7e7f8) = -1 errno=2 (No such file or 
directory)
15382 open("/lib/tls/libc.so.6",0,07776463300) = -1 errno=2 (No such file or 
directory)
15382 stat64("/lib/tls",0x3ff7e7f8) = -1 errno=2 (No such file or directory)
15382 open("/lib/fast-mult/half/libc.so.6",0,07776463300) = -1 errno=2 (No such 
file or directory)
15382 stat64("/lib/fast-mult/half",0x3ff7e7f8) = -1 errno=2 (No such file or 
directory)
15382 open("/lib/fast-mult/libc.so.6",0,07776463300) = -1 errno=2 (No such file 
or directory)
15382 stat64("/lib/fast-mult",0x3ff7e7f8) = -1 errno=2 (No such file or 
directory)
15382 open("/lib/half/libc.so.6",0,07776463300) = -1 errno=2 (No such file or 
directory)
15382 stat64("/lib/half",0x3ff7e7f8) = -1 errno=2 (No such file or directory)
15382 open("/lib/libc.so.6",0,07776463300) = 3
15382 read(3,0x3ff7e8ec,512) = 512
15382 fstat64(3,0x3ff7e7f8) = 0
15382 mmap2(0,4096,3,34,-1,0) = 0x41f81000
15382 mmap2(0,1212984,5,2050,3,0) = 0x41f82000
15382 mprotect(1107939328,32768,0,24,1073211056,1106776064) = 0
15382 mmap2(1107972096,12288,3,2066,3,283) = 0x420a5000
15382 mmap2(1107984384,8760,3,50,-1,0) = 0x420a8000
15382 close(3) = 0
15382 mmap2(0,4096,3,34,-1,0) = 0x420ab000
15382 mprotect(1107972096,8192,1,1073372672,1073373184,1106776064) = 0
15382 mprotect(1073369088,4096,1,1073372672,1073373184,1073373896) = 0
15382 exit_group(0)

Does anyone have any hints how to solve this situation? Can I set up the
target somehow to use the -B option by default?

Thanks,

Matej


_______________________________________________
Scratchbox-users mailing list
Scratchbox-users@lists.scratchbox.org
http://lists.scratchbox.org/cgi-bin/mailman/listinfo/scratchbox-users

Reply via email to