Rob Landley | 13 Dec 05:16
Gravatar

Re: [uml-user] Debian root_fs images

On Monday 12 December 2005 14:20, Blaisorblade wrote:
> First, you can say con1=fd:0,fd:1 instead to redirect tty1 to stdin/out,
> however you just need to add an entry in inittab for tty0 along with tty1
> and list tty0 in /etc/*securetty* (path varies) to allow root to login from
> tty0. Don't use /dev/console as that is very different and has problems
> (aka Ctrl-C, Ctrl-Z don't work, for instance).

It's a little more complicated than that.  Signals are blocked for PID 1 so 
Ctrl-C and Ctrl-Z can't ever work for init=/bin/sh.

Attached is a dumb little program I use to get around this.

Rob
--

-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.
Attachment (oneit.c): text/x-csrc, 1168 bytes
Matthew Palmer | 13 Dec 06:09
Favicon

[uml-user] Re: Hangs at boot time

On Mon, Dec 12, 2005 at 09:25:04PM +0100, Blaisorblade wrote:
> On Monday 12 December 2005 08:20, Matthew Palmer wrote:
> > I'm running into problems booting UMLs at present, with a regular (though
> > not 100% consistent) hang at the point where the root filesystem is
> > mounted.
> 
> > line_ioctl: tty0: ioctl KDSIGACCEPT called
> (Ignore that, it's a harmless warning).

I thought it might have been indicative of a
warning-turned-fatal-via-race-condition or something odd like that.

> > Environment:
> > /usr/bin/linux is 2.6.11um-1 (built from custom Ubuntu packages)
> > kernel is 2.6.12umlhost-skas3-v8.2
> > Running an Ubuntu hoary image
> 
> > Is this a known bug in any form?  Does it look familiar? 
> 
> No, but unless you have already setup custom-built kernels, I'd first check 
> if, simply, there's some problem with console configuration (say console 
> channels disabled, for instance)...

It was working nicely a while ago, and as I say it works every now and then
(on an identical command line -- I can run /usr/bin/linux [...], have it
boot up, log in, shut the VM down again, press up-arrow, then enter, and
it'll hang) so I'm thinking it probably isn't a console/config error (along
with the fact that it does it's whole mmap2() thing when it hangs).

> > Any recommended 
(Continue reading)

Karamazov Brothers | 13 Dec 07:14
Picon

[uml-user] UML immediate segfault on RHEL4 regardless CONFIG_HOST_2G_2G

Hi all,

Puzzled and need some help.

I downloaded the stock linux-2.6.14.3.tar.bz2, and
tried to make ARCH=um on RedHat's Enterprise Linux 4 update 2.  And the output segfaults immediately.

My procedures are as follows:
1) cd linux-2.6.14.3
2) make menuconfig ARCH=um
    2a) enable CONFIG_HOST_2G_2G, or
    2b) disable CONFIG_HOST_2G_2G
    and accept all other defaults.
3) make linux ARCH=um
4) ./linux --> immediate segfault (for both config 2a and 2b)

My RHEL4 update 2 is running kernel-2.6.9-22.EL.

I tried many many other prebuilt binaries from various
sites.  Most of them fail.  What should I do to make it work?

Ken

Karamazov Brothers | 13 Dec 08:18
Picon

[uml-user] Re: UML immediate segfault on RHEL4 regardless CONFIG_HOST_2G_2G

Hi all,

A bit more debugging information.  Gdb shows that ./linux segfaults
at the same location in os_early_checks () at arch/um/os-Linux/start_up.c:264
no matter CONFIG_HOST_2G_2G is defined or not.  Any clue how to fix?
See my earlier email below for my kernel settings.  Thanks for your help.

Ken

# gdb ./linux
GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome 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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) run
Starting program: /root/linux-2.6.14.3/linux

Program received signal SIGSEGV, Segmentation fault.
_raw_spin_lock (lock=0x602bfb70) at include/asm/thread_info.h:47
47      {
(gdb) bt
#0  _raw_spin_lock (lock=0x602bfb70) at include/asm/thread_info.h:47
#1  0x000000006020de18 in _spin_lock_irqsave (lock=0x602bfb70)
    at kernel/spinlock.c:78
#2  0x000000006002d777 in vprintk (
    fmt=0x60234ee8 "Checking that ptrace can change system call numbers...",
    args=0x7fbffff470) at kernel/printk.c:540
#3  0x000000006002d730 in printk (fmt=Variable "fmt" is not available.
) at kernel/printk.c:516
#4  0x0000000060026989 in os_early_checks () at arch/um/os-Linux/start_up.c:264
#5  0x0000000060019e7f in linux_main (argc=1, argv=0x7fbffff908)
    at arch/um/kernel/um_arch.c:336
#6  0x0000000060012fda in main (argc=1, argv=0x7fbffff908, envp=0x7fbffff918)
    at arch/um/kernel/main.c:152


On 12/13/05, Karamazov Brothers <karamazov.brothers <at> gmail.com> wrote:
Hi all,

Puzzled and need some help.

I downloaded the stock linux-2.6.14.3.tar.bz2, and
tried to make ARCH=um on RedHat's Enterprise Linux 4 update 2.  And the output segfaults immediately.

My procedures are as follows:
1) cd linux-2.6.14.3
2) make menuconfig ARCH=um
    2a) enable CONFIG_HOST_2G_2G, or
    2b) disable CONFIG_HOST_2G_2G
    and accept all other defaults.
3) make linux ARCH=um
4) ./linux --> immediate segfault (for both config 2a and 2b)

My RHEL4 update 2 is running kernel-2.6.9-22.EL.

I tried many many other prebuilt binaries from various
sites.  Most of them fail.  What should I do to make it work?

Ken

Christoph | 13 Dec 12:45
Picon

Re: [uml-user] Instant Segfault when running UML

On 12/7/05, Christoph Dwertmann <cdwertmann <at> gmx.de> wrote:
> On Wed, Dec 07, 2005 at 07:09:47PM +0100, Blaisorblade wrote:
> > On Wednesday 07 December 2005 17:07, Christoph Dwertmann wrote:
> > > Hi!
> >
> > > I'm trying to build my own UML kernel here. It builds fine, but
> > > executing the kernel leads to:
> >
> > > GDB shows this:
> >
> > > Program received signal SIGSEGV, Segmentation fault.
> > > 0xa028a2d5 in __libc_setup_tls ()
> > > Current language:  auto; currently asm
> > > (gdb) bt
> > > #0  0xa028a2d5 in __libc_setup_tls ()
> > > #1  0xa028a66f in __pthread_initialize_minimal ()
> > > #2  0xa028a045 in __libc_start_main ()
> > > #3  0xa0014021 in _start () at ../sysdeps/i386/elf/start.S:119
> >
> > Ok, it's due to some weird toolchain-related bug.
> >
> > > I've built kernels 2.4.23, 2.4.27, 2.4.28 and 2.6.14 with
> > > Blaisorblade's UML patches. The host kernel is 2.6.15-rc5 vanilla, and
> > > I'm running Debian sid (updated daily) on x86.
> >
> > Ok, it's a bug in some new binutils/GCC/glibc. While we try to debug the
> > thing, can you post the releases of these 3 components? Also, can you upload
> > somewhere and post the URL of your compressed "ld" binary?
>
> Hi, thanks for your reply. Here's my configuration:
>
> alderaan:~/uml# gcc --version
> gcc (GCC) 4.0.3 20051201 (prerelease) (Debian 4.0.2-5)
>
> alderaan:~/uml# dpkg -l | grep binutils
> ii  binutils  2.16.1cvs20051117-1
>
> alderaan:~/uml# dpkg -l | grep glibc
> ii  libstdc++2.10-glibc2.2               2.95.4-24
> (is this the package containing glibc?)
>
> alderaan:~/uml# dpkg -l | grep libc6
> ii  libc6                                2.3.5-8.1
> ii  libc6-dev                            2.3.5-8.1
>
> Grab my ld binary here:
> http://www.informatik.uni-bremen.de/~nermal/ld.bz2
>
> > Btw, to help with the current problem (while fixing the bug), have you any
> > need unsatisified by existing binaries (either on my site or on
> > uml.nagafix.co.uk ?).
>
> yeah I need to apply a few custom kernel patches, and maybe modify
> them to fit my needs. I really need to be able to compile my own UML
> kernels. But thanks for the offer!
>
> > > Renaming /lib/tls does not help.
> >
> > Even doing that on the host? In this (exceptional) case, the result of that
> > may be useful.
>
> I just re-checked that: it makes no difference.
>
> I noticed that most of the people having this error use a recent
> Debian or Gentoo system. The cause must be somewhere in my build
> system, as precompiled binaries run.
>
> Thanks,
>
> Christoph

Hey Blaisorblade and all the others,

does anyone have any idea what causes this instant segfault? I'm still
stuck here.

Thanks,

Christoph

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
Jeff Dike | 13 Dec 18:13

Re: [uml-user] Debian root_fs images

On Mon, Dec 12, 2005 at 10:16:34PM -0600, Rob Landley wrote:
> It's a little more complicated than that.  Signals are blocked for PID 1 so 
> Ctrl-C and Ctrl-Z can't ever work for init=/bin/sh.

It's not init getting the signal - it's whatever other process is running.

The issue is whether the console supports job control or not.

				Jeff

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Jeff Dike | 13 Dec 18:17

Re: [uml-user] Re: UML immediate segfault on RHEL4 regardless CONFIG_HOST_2G_2G

On Tue, Dec 13, 2005 at 03:18:10PM +0800, Karamazov Brothers wrote:
> Program received signal SIGSEGV, Segmentation fault.
> _raw_spin_lock (lock=0x602bfb70) at include/asm/thread_info.h:47
> 47      {
> (gdb) bt
> #0  _raw_spin_lock (lock=0x602bfb70) at include/asm/thread_info.h:47
> #1  0x000000006020de18 in _spin_lock_irqsave (lock=0x602bfb70)
>     at kernel/spinlock.c:78

Do you have CONFIG_SMP enabled?  I can't see any other reason you'd be
getting spinlocks involved.

				Jeff

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Blaisorblade | 13 Dec 18:18
Picon
Favicon

Re: [uml-user] Debian root_fs images

On Tuesday 13 December 2005 05:16, Rob Landley wrote:
> On Monday 12 December 2005 14:20, Blaisorblade wrote:
> > First, you can say con1=fd:0,fd:1 instead to redirect tty1 to stdin/out,
> > however you just need to add an entry in inittab for tty0 along with tty1
> > and list tty0 in /etc/*securetty* (path varies) to allow root to login
> > from tty0. Don't use /dev/console as that is very different and has
> > problems (aka Ctrl-C, Ctrl-Z don't work, for instance).

> It's a little more complicated than that.  Signals are blocked 

Except the ones for which PID 1 installed a signal handler. But yep, this is 
part of the picture, too.

> for PID 1 so 
> Ctrl-C and Ctrl-Z can't ever work for init=/bin/sh.

That's using /dev/console which doesn't become a controlling tty, and you know 
that since you tried to hack the !noctty test somewhere in TTY handling code.

> Attached is a dumb little program I use to get around this.

Yep, this program makes sense - it attacks both problems (/dev/console and PID 
1).
--

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.messenger.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Philip S. Hempel | 13 Dec 19:29

Re: [uml-user] Instant Segfault when running UML

Christoph wrote:

<chomp>
>
>> stoph
>>     
>
> Hey Blaisorblade and all the others,
>
> does anyone have any idea what causes this instant segfault? I'm still
> stuck here.
>
> Thanks,
>
> Christoph
>
>
>   
The most updated version of cpp seems to have fixed this.. for me.. I
have successfully built a image that does not segfault on my AMD64 box..

Not to find if I can get an image to boot with the built in on AMD64
tls... sheesh

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
Blaisorblade | 13 Dec 19:14
Picon
Favicon

Re: [uml-user] Re: UML immediate segfault on RHEL4 regardless CONFIG_HOST_2G_2G

On Tuesday 13 December 2005 08:18, Karamazov Brothers wrote:
> Hi all,
>
> A bit more debugging information.  Gdb shows that ./linux segfaults
> at the same location in os_early_checks () at
> arch/um/os-Linux/start_up.c:264
> no matter CONFIG_HOST_2G_2G is defined or not.  Any clue how to fix?

I know this hang well, but until now I saw it just when I enable either SMP or 
spinlock debugging enabled.

FOR Jeff Dike:

It seems due (for what I saw) to a process faulting in a page from the stack 
area (it's still the initial stack, so mapped VM_GROWSDOWN) with an address < 
%esp.

And as you know, the kernel says that you are buggy, and it's indeed right 
since a concurrent signal handler would kill you.

This started showing up with the Ingo Molnar's locking restructure and 
abstraction, for me. He reimplemented spinlock debugging, and then spinlock 
debugging started triggering this. I'm not sure this is the correct 
diagnosis, but when I debugged it (or similar crashes), this sounded 
reasonable.

However, in this case, the hang is going on on logbuf_lock, so it puzzles me a 
lot.

> See my earlier email below for my kernel settings.  Thanks for your help.

> Ken

> # gdb ./linux

> Program received signal SIGSEGV, Segmentation fault.

lock value below is invalid, GDB is messing on the stack with

> _raw_spin_lock (lock=0x602bfb70) at include/asm/thread_info.h:47
> 47      {
> (gdb) bt
> #0  _raw_spin_lock (lock=0x602bfb70) at include/asm/thread_info.h:47
> #1  0x000000006020de18 in _spin_lock_irqsave (lock=0x602bfb70)
>     at kernel/spinlock.c:78
> #2  0x000000006002d777 in vprintk (
>     fmt=0x60234ee8 "Checking that ptrace can change system call
> numbers...", args=0x7fbffff470) at kernel/printk.c:540
> #3  0x000000006002d730 in printk (fmt=Variable "fmt" is not available.
> ) at kernel/printk.c:516
> #4  0x0000000060026989 in os_early_checks () at
> arch/um/os-Linux/start_up.c:264
> #5  0x0000000060019e7f in linux_main (argc=1, argv=0x7fbffff908)
>     at arch/um/kernel/um_arch.c:336
> #6  0x0000000060012fda in main (argc=1, argv=0x7fbffff908,
> envp=0x7fbffff918)
>     at arch/um/kernel/main.c:152

> On 12/13/05, Karamazov Brothers <karamazov.brothers <at> gmail.com> wrote:
> > Hi all,
> >
> > Puzzled and need some help.
> >
> > I downloaded the stock linux-2.6.14.3.tar.bz2, and
> > tried to make ARCH=um on RedHat's Enterprise Linux 4 update 2.  And the
> > output segfaults immediately.
> >
> > My procedures are as follows:
> > 1) cd linux-2.6.14.3

Here, you possibly could benefit from a "make defconfig ARCH=um" to get a 
basis .config - {menu,x,*}config tend to pick host settings (which are not 
good for UML) as default.

> > 2) make menuconfig ARCH=um
> >     2a) enable CONFIG_HOST_2G_2G, or
> >     2b) disable CONFIG_HOST_2G_2G
> >     and accept all other defaults.
> > 3) make linux ARCH=um
> > 4) ./linux --> immediate segfault (for both config 2a and 2b)
> >
> > My RHEL4 update 2 is running kernel-2.6.9-22.EL.
> >
> > I tried many many other prebuilt binaries from various
> > sites.  Most of them fail.  What should I do to make it work?

Wait a moment - most of them fail is strange, but 
a) if some works that's a good point - we may later need to distinguish 
between working and not working ones.

b) failures could be due to different reasons. The above one is almost surely 
due to SMP/spinlock debug, but released binaries shouldn't have these options 
enabled.

--

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

		
___________________________________ 
Yahoo! Messenger: chiamate gratuite in tutto il mondo 
http://it.messenger.yahoo.com

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

Gmane