[uml-devel] gdb can not start up in UML and signal 11 issues

2005-04-05 Thread Wu Haibao-a15761



Hi,
    I'm running UML 2.4.26 on customerized linux 2.4.21, and met the 
following problems which I can not figure out:
    1. gdb does not come up with a command line prompt when I add the "debug" 
option in the uml (in tt mode), it just hang up with these 
message:

GNU gdb Red Hat 
Linux (6.1post-1.20040607.17rh)Copyright 2004 Free Software Foundation, 
Inc.GDB is free software, covered by the GNU General Public License, and you 
arewelcome to change it and/or distribute copies of it under certain 
conditions.Type "show copying" to see the conditions.There is absolutely 
no warranty for GDB.  Type "show warranty" for details.This GDB was 
configured as "i386-redhat-linux-gnu"...Using host libthread_db library 
"/lib/libthread_db.so.1".

    

    2. After 
starting UML without the debug option and running some applications, it hangs 
up.  I found the the tt thread is working with endless signal 11 (SIGSEGV) 
from an application. I just wonder why so many SIGSEGV signals are sent.  
Actually after I add some log to the UML, I found  that almost every 
application sent SIGSEGV to tt, why this happens?
 
    Could you 
please give any suggestion on these?
    
Thanks.
 
Regards,
Wu 
Haibao
 
--- [ ] General Business Information [x] Motorola Internal Use Only [ ] 
Motorola Confidential Proprietary 
 


[uml-devel] UML on s390 (31Bit)

2005-04-05 Thread Bodo Stroesser
Hi,
currently I'm porting UML to s390 31-bit.
A first 2.6.11 UML system already is running in UML-SKAS0 mode,
which normally should run on an unpatched host (no skas3-patch).
To make UML build and run on s390, I needed to do these two little
changes (the patches are copy and paste. I hope that doesn't hurt,
since they are very small):
1) UML includes some of the subarch's (s390) headers. I had to
   change one of them with the following one-liner, to make this
   compile. AFAICS, this change doesn't break compilation of s390
   itself.
==
--- linux-2.6.11.orig/include/asm-s390/user.h   2004-12-09 18:45:02.0 
+0100
+++ linux-2.6.11/include/asm-s390/user.h2004-12-09 18:48:11.0 
+0100
@@ -10,7 +10,7 @@
 #define _S390_USER_H
 #include 
-#include 
+#include 
 /* Core file format: The core file is written in such a way that gdb
can understand it and provide useful information to the user (under
linux we use the 'trad-core' bfd).  There are quite a number of
==
2) UML needs to intercept syscalls via ptrace to invalidate the syscall,
   read syscall's parameters and write the result with the result of
   UML's syscall processing. Also, UML needs to make sure, that the host
   does no syscall restart processing. On i386 for example, this can be
   done by writing -1 to orig_eax on the 2nd syscall interception
   (orig_eax is the syscall number, which after the interception is used
   as a "interrupt was a syscall" flag only.
   Unfortunately, s390 holds syscall number and syscall result in gpr2 and
   its "interrupt was a syscall" flag (trap) is unreachable via ptrace.
   So I changed the host to set trap to -1, if the syscall number is written
   to a negative value on the first syscall interception.
   I hope, this adds what UML needs without changing ptrace visibly to other
   ptrace users.
   (This isn't tested on a 2.6 host yet, because my host still is a 2.4.21 SuSE.
   But I've adapted this change to 2.4 and tested, it works.)
==
--- linux-2.6.11.orig/arch/s390/kernel/ptrace.c 2005-04-04 18:57:38.0 
+0200
+++ linux-2.6.11/arch/s390/kernel/ptrace.c  2005-04-04 19:01:51.0 
+0200
@@ -726,6 +726,13 @@
  ? 0x80 : 0));
/*
+* If debugger has set an invalid syscall number,
+* we prepare to skip syscall restart handling
+*/
+   if (!entryexit && (long )regs->gprs[2] < 0 )
+   regs->trap = -1;
+
+   /*
 * this isn't the same as continuing with a signal, but it will do
 * for normal use.  strace only continues with a signal if the
 * stopping signal is not SIGTRAP.  -brl
==
It would be very helpful for me, if these changes could go into s390 
mainline.
If there is something wrong with them, please help me find a better solution.
Regards, Bodo
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] question about UML sigcontext in tt mode

2005-04-05 Thread Rob Landley
On Monday 04 April 2005 10:00 am, Jeff Dike wrote:
> On Thu, Mar 31, 2005 at 06:03:34PM +0800, Alex LIU wrote:
> > union uml_pt_regs {
> > #ifdef UML_CONFIG_MODE_TT
> > struct tt_regs {
> > long syscall;
> > void *sc;
> > } tt;
> > #endif
> > };
> > -
> >
> > Then why the tt.sc is defined as void while not as struct sigcontext?
> > Thanks!
>
> Probably because you can't get a definition of struct sigcontext into
> processor.h and have it still compile.
>
> Try #including sigcontext.h there and you'll see what I mean.

I don't know about can't.

#define sigcontext WALRUS
#include 
thingy
#undef WALRUS

Adviseable is another matter entirely.  (Did I mention I have a knack for 
coming up with disgusting solutions to impossible problems?)

Rob


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] 2.6.9-bs7 panic on check_sysemu

2005-04-05 Thread Rob Landley
On Monday 04 April 2005 09:32 am, Blaisorblade wrote:

> > Is this a case where I should be upgrading my host kernels (will do that
> > in time anyway)?
>
> You simply need to update the SKAS patch version. -V2 is very old, and many
> bugs (including this, that is a bug in the SYSEMU part of the SKAS patch).
> Upgrading to -V7 for the SKAS patch, even on the same host kernel version
> (i.e. against 2.6.8.1), would fix that.
>
> Also, some older guest kernels may seem to work, because they don't
> diagnose such bugs. But actually they have problems in some situations,
> because of the host bugs. For instance panicking with a simple "echo 0 >
> /proc/sysemu; echo 1 > /proc/sysemu".
>
> > Or is there something that can be done on the guest to make it work on
> > older kernels also?
>
> Not a lot, except disabling SYSEMU (and its performance advantage) entirely
> - add the "nosysemu" param to the UML command line and it will work.
>
> But it won't be as slow as if you didn't use SKAS.
>
> Bye

Speaking of which, I ask this from time to time:

What's the minimal patch set that _just_ adds -SKAS0 mode to something like a 
2.6.11 kernel?  I'd like to try it out, but every time I sit down to whack at 
it my interest budget runs out sifting through a mountain of unrelated x86-64 
patches to try to figure out what exactly I need to apply to get just 
SKAS0...

No biggie.  I'll can always ask again later... :)

Rob


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] 2.6.9-bs7 panic on check_sysemu

2005-04-05 Thread Blaisorblade
On Tuesday 05 April 2005 19:23, Rob Landley wrote:
> On Monday 04 April 2005 09:32 am, Blaisorblade wrote:
> > > Is this a case where I should be upgrading my host kernels (will do
> > > that in time anyway)?

> > You simply need to update the SKAS patch version. -V2 is very old, and
> > many bugs (including this, that is a bug in the SYSEMU part of the SKAS
> > patch). Upgrading to -V7 for the SKAS patch, even on the same host kernel
> > version (i.e. against 2.6.8.1), would fix that.

> > Also, some older guest kernels may seem to work, because they don't
> > diagnose such bugs. But actually they have problems in some situations,
> > because of the host bugs. For instance panicking with a simple "echo 0 >
> > /proc/sysemu; echo 1 > /proc/sysemu".

> > > Or is there something that can be done on the guest to make it work on
> > > older kernels also?

> > Not a lot, except disabling SYSEMU (and its performance advantage)
> > entirely - add the "nosysemu" param to the UML command line and it will
> > work.

> > But it won't be as slow as if you didn't use SKAS.

> > Bye

> Speaking of which, I ask this from time to time:

> What's the minimal patch set that _just_ adds -SKAS0 mode to something like
> a 2.6.11 kernel?  I'd like to try it out, but every time I sit down to
> whack at it my interest budget runs out sifting through a mountain of
> unrelated x86-64 patches to try to figure out what exactly I need to apply
> to get just SKAS0...

> No biggie.  I'll can always ask again later... :)

The problem is that I don't use the Jeff's tree nor work on SKAS0, since 
somebody must work on current releases.

While Jeff is loaded with development work and cannot handle every user. I too 
have sometimes problem to keep in touch with him.

That said, check if applying the whole tree (until the point patches apply) 
works for you.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] 2.6.9-bs7 panic on check_sysemu

2005-04-05 Thread Blaisorblade
On Tuesday 05 April 2005 19:23, Rob Landley wrote:
> On Monday 04 April 2005 09:32 am, Blaisorblade wrote:
> > > Is this a case where I should be upgrading my host kernels (will do
> > > that in time anyway)?
> >
> > You simply need to update the SKAS patch version. -V2 is very old, and
> > many bugs (including this, that is a bug in the SYSEMU part of the SKAS
> > patch). Upgrading to -V7 for the SKAS patch, even on the same host kernel
> > version (i.e. against 2.6.8.1), would fix that.
> >
> > Also, some older guest kernels may seem to work, because they don't
> > diagnose such bugs. But actually they have problems in some situations,
> > because of the host bugs. For instance panicking with a simple "echo 0 >
> > /proc/sysemu; echo 1 > /proc/sysemu".
> >
> > > Or is there something that can be done on the guest to make it work on
> > > older kernels also?
> >
> > Not a lot, except disabling SYSEMU (and its performance advantage)
> > entirely - add the "nosysemu" param to the UML command line and it will
> > work.
> >
> > But it won't be as slow as if you didn't use SKAS.
> >
> > Bye
>
> Speaking of which, I ask this from time to time:
>
> What's the minimal patch set that _just_ adds -SKAS0 mode to something like
> a 2.6.11 kernel?  I'd like to try it out, but every time I sit down to
> whack at it my interest budget runs out sifting through a mountain of
> unrelated x86-64 patches to try to figure out what exactly I need to apply
> to get just SKAS0...
Also, I forgot: during your development work use SKAS. It doesn't give any big 
difference visible inside the Virtual Machine (except for bugs).
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] question about UML sigcontext in tt mode

2005-04-05 Thread Blaisorblade
On Tuesday 05 April 2005 19:20, Rob Landley wrote:
> On Monday 04 April 2005 10:00 am, Jeff Dike wrote:
> > On Thu, Mar 31, 2005 at 06:03:34PM +0800, Alex LIU wrote:
> > > union uml_pt_regs {
> > > #ifdef UML_CONFIG_MODE_TT
> > >  struct tt_regs {
> > >   long syscall;
> > >   void *sc;
> > >  } tt;
> > > #endif
> > > };
> > > -
> > >
> > > Then why the tt.sc is defined as void while not as struct sigcontext?
> > > Thanks!
> >
> > Probably because you can't get a definition of struct sigcontext into
> > processor.h and have it still compile.
> >
> > Try #including sigcontext.h there and you'll see what I mean.
>
> I don't know about can't.
>
> #define sigcontext WALRUS
> #include 
> thingy
> #undef WALRUS
>
> Adviseable is another matter entirely.  (Did I mention I have a knack for
> coming up with disgusting solutions to impossible problems?)
I've not tested if it's impossible in this very case, however: if any host 
header includes kernel headers on the host, and we include it from a 
kernelspace file, we run into trouble.

So, defining away like you do above every and each identifier present in every 
possible versions of glibc / kernel headers would indeed work. Is this still 
a solution?

So, we cut the problem by excluding the unusable headers from the compiler 
search path. arch/um/include are includable everywhere, /usr/include from 
userspace files, /include/{asm,linux,*}/ from kernelspace 
only.

If you really come up with a general solution, let us know. Please. Thanks for 
you effort anyway.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] 2.6.9-bs7 panic on check_sysemu

2005-04-05 Thread Jeff Dike
On Tue, Apr 05, 2005 at 01:23:47PM -0400, Rob Landley wrote:
> What's the minimal patch set that _just_ adds -SKAS0 mode to something like a 
> 2.6.11 kernel?  I'd like to try it out, but every time I sit down to whack at 
> it my interest budget runs out sifting through a mountain of unrelated x86-64 
> patches to try to figure out what exactly I need to apply to get just 
> SKAS0...

There isn't really one right now.  Those patches need to be cleaned up, 
merged, and disentanged from other stuff.

Jeff


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


[uml-devel] Broken compiling under 2.6.12-rc2 on my machine

2005-04-05 Thread Ian McDonald
Hi there,

I have applied 2.6.12-rc2 patches against 2.6.11 and gone to compile
and it fails...

Here is what I have done:
make menuconfig ARCH=um
Added in hostfs, UML networking - daemon (but also tried with these
off, no difference)
make linux ARCH=um

Output:
  HOSTCC  usr/gen_init_cpio
  CHK usr/initramfs_list
  UPD usr/initramfs_list
  CPIOusr/initramfs_data.cpio
  GZIPusr/initramfs_data.cpio.gz
  AS  usr/initramfs_data.o
  LD  usr/built-in.o
  CC  arch/um/kernel/checksum.o
  QUOTE   arch/um/kernel/config.tmp
  QUOTE   arch/um/kernel/config.c
sed: -e expression #4, char 2: Extra characters after command
make[1]: *** [arch/um/kernel/config.c] Error 1
make: *** [arch/um/kernel] Error 2

and here is the file arch/um/kernel/.config.tmp.cmd that gets created
which I am guessing has the sed error
cmd_arch/um/kernel/config.tmp := sed -e 's/"/\\"/g' -e 's/^/"/' -e
's/$$/\\n"/' /home/iam4/linuxsrc/linux-2.6.12-rc2/.config >
arch/um/kernel/config.tmp

config.c also is 0 characters length

I can supply any other files needed.
System is Debian Woody, gcc 2.95.4

I don't know much yet about sed or the kernel build process but can
look into if nobody else makes sense of this. Just thought it was good
to get it out there considering it doesn't compile and rc2 has just
come out.

And UML does compile under 2.6.11 with a patch for gcc (which is
include in 2.6.12-rc4). Haven't yet tried 2.6.12-rc1 but can do later
if this will help.

Ian


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel