> Hmm, I published a 2.6.18 -bs patchset time ago with some bugfixes, and some
> other were merged into -stable, so you may want to try these. CKRM will still
> work with them (98 % sure).

I tried both of the following patches on vanilla 2.6.18 kernel.
(Without CKRM patch)
http://www.user-mode-linux.org/~blaisorblade/patches/guest/uml-2.6.18.1-bb2/uml-2.6.18.1-bb2.patch.bz2
and
http://www.user-mode-linux.org/~blaisorblade/patches/guest/uml-2.6.18-bb1/uml-2.6.18-bb1.patch.bz2

But still it UML didnt worked.
I used GDB to locate the point where it is failing, so i got following.
{{{
(gdb) bt
#0  __const_udelay (usecs=4295000) at arch/um/sys-i386/delay.c:36
#1  0x0806c878 in panic (fmt=0x804e79c "\203�\024h;�\035\b��\226") at
kernel/panic.c:137
#2  0x0804e79c in check_ptrace ()
#3  0x0806384b in os_early_checks () at include/linux/timer.h:41
#4  0x0805c1c3 in linux_main (argc=1, argv=0xafdc3e24) at
arch/um/kernel/um_arch.c:352
#5  0x08061fb2 in main () at include/linux/timer.h:41
(gdb)
}}}

So, what I concluded from this that, panic is getting called from
"check_ptrace" function.

To find out why exactly panic is getting called, I added few printf
statements in "check_ptrace" function in
"arch/um/os-Linux/start_up.c".
I managed to find out that panic is getting called from
{{{
if(!WIFSTOPPED(status) || (WSTOPSIG(status) != (SIGTRAP|0x80)))
                   panic("check_ptrace : expected (SIGTRAP|0x80), "
                    "got status = %d", status);
}}}
It was not calling panic in first iteration but it was calling in
second iteration inside while loop, with panic statement as
{{{
check_ptrace : expected (SIGTRAP|0x80), got status = 256
}}}
At first iteration, the value of status was "34175".

I suppose that it should have passed the condition in following "if
statement" and should have taken a break in first iteration only.
/////////////////////////////////////////////////////////////////////////////
syscall = ptrace(PTRACE_PEEKUSR, pid, PT_SYSCALL_NR_OFFSET,0);
if(syscall == __NR_getpid){
             n = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_NR_OFFSET,
__NR_getppid);
            if(n < 0)
                      panic("check_ptrace : failed to modify system "
                                 "call, errno = %d", errno);
           break ;
}
/////////////////////////////////////////////////////////////////////////////
But the value of syscall in first iteration was 252 but it was
expected to be 20 (i.e.  __NR_getpid ).
Value 252 represented "__NR_exit_group"

I am not able to proceed further from this point in debugging this problem.

> nothing of interest. Have you double-checked your compile-time options?
>
>
> Looked at what's happening with strace?
on using strace on uml i got following. But I am not able to make any
sense out of it :-(
{{{
[EMAIL PROTECTED]:~/projects/selinux/ckrm/linux-2.6.18$ strace -f ./linux
execve("./linux", ["./linux"], [/* 31 vars */]) = 0
uname({sys="Linux", node="microcosm", ...}) = 0
brk(0)                                  = 0x8275000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xa7efe000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/sse2/cmov/libutil.so.1", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/lib/tls/i686/sse2/cmov", 0xafd0d548) = -1 ENOENT (No such
file or directory)
open("/lib/tls/i686/sse2/libutil.so.1", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/lib/tls/i686/sse2", 0xafd0d548) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libutil.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260\f\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9656, ...}) = 0
mmap2(NULL, 12432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xa7efa000
mmap2(0xa7efc000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xa7efc000
close(3)                                = 0
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\240O\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1241580, ...}) = 0
mmap2(NULL, 1247388, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0xa7dc9000
mmap2(0xa7ef0000, 28672, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x127) = 0xa7ef0000
mmap2(0xa7ef7000, 10396, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa7ef7000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xa7dc8000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xa7dc7000
mprotect(0xa7ef0000, 20480, PROT_READ)  = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xa7dc76c0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
brk(0)                                  = 0x8275000
brk(0x8296000)                          = 0x8296000
rt_sigaction(SIGINT, {0x806364c, [], SA_NOMASK|SA_ONESHOT}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [INT], NULL, 8) = 0
rt_sigaction(SIGTERM, {0x806364c, [], SA_NOMASK|SA_ONESHOT}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [TERM], NULL, 8) = 0
rt_sigaction(SIGHUP, {0x806364c, [], SA_NOMASK|SA_ONESHOT}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [HUP], NULL, 8) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xa7dc6000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7dc5000
clone(Process 18247 attached
child_stack=0xa7dc5fd4, flags=|SIGCHLD) = 18247
[pid 18246] waitpid(18247, Process 18246 suspended
 <unfinished ...>
[pid 18247] getpid()                    = 18247
[pid 18247] getppid()                   = 18246
[pid 18247] rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0
[pid 18247] ptrace(PTRACE_TRACEME, 0, 0, 0) = -1 EPERM (Operation not permitted)
[pid 18247] dup(2)                      = 3
[pid 18247] fcntl64(3, F_GETFL)         = 0x2 (flags O_RDWR)
[pid 18247] fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
[pid 18247] mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7dc4000
[pid 18247] _llseek(3, 0, 0xa7dc5a50, SEEK_CUR) = -1 ESPIPE (Illegal seek)
[pid 18247] write(3, "ptrace: Operation not permitted\n", 32ptrace:
Operation not permitted
) = 32
[pid 18247] close(3)                    = 0
[pid 18247] munmap(0xa7dc4000, 4096)    = 0
[pid 18247] kill(18247, SIGKILL)        = 0
[pid 18247] +++ killed by SIGKILL +++
Process 18246 resumed
Process 18247 detached
<... waitpid resumed> [{WIFSIGNALED(s) && WTERMSIG(s) == SIGKILL}],
WSTOPPED) = 18247
--- SIGCHLD (Child exited) @ 0 (0) ---
}}}

Thanx
-- 
 Pravin Shinde
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to