Skip to contentSkip to conversation

2.6.14-rc1 x86 on 2.6.13.1 amd64 host: guest segfaults

uml-devel Antoine Martin 4 participants 8 messages Sep 15, 2005 – Sep 20, 2005 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Host is running 2.6.13.1

I tried mode=skas0 but it seems to always default to TT. Or has this not been merged in mainline yet?

***
Here is a strace of a x86 guest:
strace ./kernel32 mode=skas0 root=/dev/ubda mem=384M ubd0=./root_fs32 console0=fd:0,fd:1
(..)

gettimeofday({2451808977522855, 18446659740416081920}, NULL) = 0 open("/tmp/vm_file-WEUjnm", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
unlink("/tmp/vm_file-WEUjnm") = 0
fchmod(5, 0777) = 0
_llseek(5, 402653184, [402653184], SEEK_SET) = 0
write(5, "\0", 1) = 1
fcntl64(5, F_SETFD, FD_CLOEXEC) = 0
mmap2(0xa0800000, 394264576, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 5, 0x800) = 0xffffffffa0800000
mkdir("/root/.uml/", 0777) = -1 EEXIST (File exists)
mkdir("/root/.uml/1", 0777) = 0
open("/root/.uml/1/pid", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0644) = 6

getpid()                                = 6026
write(6, "6026\n", 5)                   = 5
close(6)                                = 0
mprotect(0xa0256000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
rt_sigaction(SIGPIPE, {0x1000000000000001, [], 0}, {SIG_DFL}, 8) = 0
socketcall(0x8, 0xffffc360)             = 0
fcntl64(6, F_SETFD, FD_CLOEXEC)         = 0
fcntl64(7, F_SETFD, FD_CLOEXEC)         = 0

rt_sigaction(SIGWINCH, {0x10000000a0019a60, [], 0}, {SIG_DFL}, 8) = 0
getpid() = 6026
write(1, "tracing thread pid = 6026\n", 26tracing thread pid = 6026 ) = 26
clone(child_stack=0xa0257fd4, flags=CLONE_FILES|SIGCHLD) = 6027 --- SIGCHLD (Child exited) @ 0 (0) ---
waitpid(6027, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSTOP}], WSTOPPED) = 6027
ptrace(0x15 /* PTRACE_??? */, 6027, 0, 0x1) = 0
ptrace(PTRACE_CONT, 6027, 0, SIG_0) = 0
rt_sigaction(SIGSEGV, {0x10000000a0019be0, [], 0}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGUSR1, {0x10000000a00184f0, [], 0}, {SIG_DFL}, 8) = 0 waitpid(4294967295, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSEGV}], WSTOPPED) = 6027
--- SIGCHLD (Child exited) @ 0 (0) ---
ptrace(PTRACE_CONT, 6027, 0, SIGSEGV) = 0
waitpid(4294967295, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGUSR1}], WSTOPPED) = 6027
--- SIGCHLD (Child exited) @ 0 (0) ---
munmap(0, 2692743168) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

**
And here is a amd64 guest:
(This trace was much much longer)
(...)
It seems to spin for an awful long time on:
rt_sigprocmask(SIG_BLOCK, [], NULL, 8) = 0 rt_sigprocmask(SIG_SETMASK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, [ALRM VTALRM IO], NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [ALRM VTALRM IO], [ALRM VTALRM IO], 8) = 0

Reducing the ram seemed to help, no idea what this is about!

Another weirdness, this command line works:

# ./kernel64 root=/dev/ubda mem=256M ubd0=./root_fs64
eth0=tuntap,tap0,FE:F0:00:00:00:01,10.0.0.254 eth1=pcap,eth0
console0=fd:0,fd:1 umid=1
But this one does not:
# ./kernel64 root=/dev/ubda mem=256M ubd0=./root_fs64
eth0=tuntap,tap0,FE:F0:00:00:00:01,10.0.0.254 eth1=pcap,eth0
console0=fd:0,fd:1 console=pty umid=1 gentoo=nodevfs nodevfs selinux=1
enforcing=0
With this one it crashes after checking for PROT_EXEC.
Is this to do with command line size limitations?

** Last issue, when running in a 2.6.14-rc1 guest, I can't 'emerge --sync', it dies before rebuilding its cache:
Here is the strace:
(..)

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

checking server timestamp ...

Timestamps on the server and in the local repository are the same. Cancelling all further sync action. You are already up to date.

) = 247
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7f7fc2da50) = -1 ENOTTY (Inappropriate ioctl for device)
stat("/var/log/emerge.log", {st_mode=S_IFREG|0660, st_size=222087, ...}) = 0
open("/var/log/emerge.log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3 fstat(3, {st_mode=S_IFREG|0660, st_size=222087, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
fstat(3, {st_mode=S_IFREG|0660, st_size=222087, ...}) = 0
lseek(3, 222087, SEEK_SET) = 222087
fstat(3, {st_mode=S_IFREG|0660, st_size=222087, ...}) = 0 fcntl(3, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0 fstat(3, {st_mode=S_IFREG|0660, st_size=222087, ...}) = 0
lseek(3, 222087, SEEK_SET) = 222087
write(3, "1126803520: *** terminating.\n", 30) = 30 fcntl(3, F_SETLKW, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
close(3) = 0
munmap(0x40018000, 4096) = 0
ioctl(2, SNDCTL_TMR_TIMEBASE or TCGETS, 0x7f7fc2daf0) = -1 ENOTTY (Inappropriate ioctl for device)
wait4(-1, 0x7f7fc2e034, 0, NULL) = -1 ECHILD (No child processes)
open("/var/cache/edb/mtimedb", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3 fstat(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 fstat(3, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
write(3, "\200\2}q\1(U\4infoq\2}q\3(U\17/usr/share/i"..., 1772) = 1772
close(3) = 0
munmap(0x40018000, 4096) = 0
chown("/var/cache/edb/mtimedb", 0, 250) = 0
chmod("/var/cache/edb/mtimedb", 0664) = 0
rt_sigaction(SIGINT, NULL, {0x403330d0, [], SA_RESTORER, 0x40b72ba0}, 8) = 0
rt_sigaction(SIGINT, {SIG_DFL}, NULL, 8) = 0 rt_sigaction(SIGTERM, NULL, {0x403330d0, [], SA_RESTORER, 0x40b72ba0},
8) = 0
rt_sigaction(SIGTERM, {SIG_DFL}, NULL, 8) = 0

munmap(0x4009f000, 200704)              = 0
close(4)                                = 0
munmap(0x40016000, 4096)                = 0
munmap(0x40017000, 4096)                = 0
exit_group(0)                           = ?

Any clues?

Thanks
Antoine

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 2 lines · Antoine Martin

I tried mode=skas0 but it seems to always default to TT. Or has this not been merged in mainline yet?

It's in mainline. What's the guest?

Quoted 3 lines

**
And here is a amd64 guest:
(This trace was much much longer)

Did this one come up in skas0 or tt mode?

Quoted 4 lines

Another weirdness, this command line works:

# ./kernel64 root=/dev/ubda mem=256M ubd0=./root_fs64
eth0=tuntap,tap0,FE:F0:00:00:00:01,10.0.0.254 eth1=pcap,eth0
console0=fd:0,fd:1 umid=1

What's with the console* business? The switch is "con".

Quoted 7 lines

But this one does not:

# ./kernel64 root=/dev/ubda mem=256M ubd0=./root_fs64
eth0=tuntap,tap0,FE:F0:00:00:00:01,10.0.0.254 eth1=pcap,eth0
console0=fd:0,fd:1 console=pty umid=1 gentoo=nodevfs nodevfs selinux=1
enforcing=0
With this one it crashes after checking for PROT_EXEC.
Is this to do with command line size limitations?

Maybe, but it probably shouldn't crash.

Quoted 1 line

write(3, "1126803520: *** terminating.\n", 30) = 30

This bit seems relevent - were there any syscall failures above that?

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#2 lore raw
Quoted 5 lines · Jeff Dike
Quoted 2 lines · Antoine Martin

I tried mode=skas0 but it seems to always default to TT. Or has this not been merged in mainline yet?

It's in mainline. What's the guest?

2.6.14-rc1

Quoted 5 lines
Quoted 3 lines

**
And here is a amd64 guest:
(This trace was much much longer)

Did this one come up in skas0 or tt mode?

I think it was tt (will check tomorrow on that box) As I said above, it seems to always use TT, ignoring mode=skas0

Quoted 6 lines
Quoted 4 lines

Another weirdness, this command line works:

# ./kernel64 root=/dev/ubda mem=256M ubd0=./root_fs64
eth0=tuntap,tap0,FE:F0:00:00:00:01,10.0.0.254 eth1=pcap,eth0
console0=fd:0,fd:1 umid=1

What's with the console* business? The switch is "con".

DOH Can't trust my memory! That's why I try to use scripts..

Quoted 9 lines
Quoted 7 lines

But this one does not:

# ./kernel64 root=/dev/ubda mem=256M ubd0=./root_fs64
eth0=tuntap,tap0,FE:F0:00:00:00:01,10.0.0.254 eth1=pcap,eth0
console0=fd:0,fd:1 console=pty umid=1 gentoo=nodevfs nodevfs selinux=1
enforcing=0
With this one it crashes after checking for PROT_EXEC.
Is this to do with command line size limitations?

Maybe, but it probably shouldn't crash.

Yep, it isn't even that big.

Quoted 4 lines
Quoted 2 lines

write(3, "1126803520: *** terminating.\n", 30) = 30

This bit seems relevent - were there any syscall failures above that?

What I am looking for?
I could just drop the full log on a public server if that helps.

Antoine

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#3 lore raw

Here is another problem that may be of interest:
host is 2.6.13.1 amd64
guest is 2.6.14-rc1

after issuing a uml_mconsole N reboot, I got (from stdout):
" * Starting local... [ ok ]
deactivate_all_fds failed, errno = 9

I/O possible"

And the guest just stopped there. Not sure why.

Antoine

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#4 lore raw
Quoted 5 lines · antoine

after issuing a uml_mconsole N reboot, I got (from stdout):
" * Starting local... [ ok ]
deactivate_all_fds failed, errno = 9

I/O possible"

Was this booting up or shutting down? The "starting local" business suggests booting, but deactivate_all_fds is only called at shutdown.

I'm chasing a similar bug, which seems to be exercised by hotplugging devices.

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#5 lore raw
Quoted 9 lines · Jeff Dike
Quoted 5 lines · antoine

after issuing a uml_mconsole N reboot, I got (from stdout):
" * Starting local... [ ok ]
deactivate_all_fds failed, errno = 9

I/O possible"

Was this booting up or shutting down? The "starting local" business suggests booting, but deactivate_all_fds is only called at shutdown.

'starting local' was the last message of the boot process (no login screen on this console)
I was shutting down with uml_mconsole N reboot
(I believe this does the equivalent of a 'init 6')
This instance was quite short on memory - which may have caused or helped trigger this.

Antoine

Quoted 4 lines

I'm chasing a similar bug, which seems to be exercised by hotplugging devices.

Jeff

-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#6 lore raw
In reply to antoine
Quoted 9 lines · antoine
Quoted 5 lines · Jeff Dike
Quoted 2 lines · Antoine Martin

I tried mode=skas0 but it seems to always default to TT. Or has this not been merged in mainline yet?

It's in mainline. What's the guest?

2.6.14-rc1

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

**
And here is a amd64 guest:
(This trace was much much longer)

Did this one come up in skas0 or tt mode?

I think it was tt (will check tomorrow on that box) As I said above, it seems to always use TT, ignoring mode=skas0

I have a little trick I do, which is to build a minimal UML with hostfs (sample config file attached), and then booting it ala:

./linux rootfstype=hostfs rootflags=/ rw mem=48M init=/bin/sh

This should come up with /bin/sh as pid 1 attached to /dev/console which is going to stdin and stdout of the UML process. (I.E. bog simple uml wrapper for a command shell.)

If I compile it in tt mode, it works fine on ubuntu (hoar-infested hedgehog release).

If I compile it instead for skas mode, it makes it all the way to mounting the rootfs (which it will only do if skas0 is in, because the ubuntu host kernel doesn't have skas support), but then barfs saying it can't intialize the TLS environment, kills PID 1, dumps a panic, and gives me my host kernel's shell prompt back.

(Easy way to tell which system you're running: "whoami". If it says root, you're in the child kernel. "mount -t proc /proc /proc" followed by "cat /proc/cpuinfo" is good too...)

When I build both in, skas0 wins (at least in that it gives me the can't setup tls message and corresponding panic).

Rob

CONFIG_GENERIC_HARDIRQS=y
CONFIG_UML=y
CONFIG_MMU=y
CONFIG_UID16=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_IRQ_RELEASE_METHOD=y
CONFIG_MODE_SKAS=y
CONFIG_UML_X86=y
CONFIG_TOP_ADDR=0xc0000000
CONFIG_STUB_CODE=0xbfffe000
CONFIG_STUB_DATA=0xbffff000
CONFIG_STUB_START=0xbfffe000
CONFIG_ARCH_HAS_SC_SIGNALS=y
CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y
CONFIG_FLATMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_LD_SCRIPT_DYN=y
CONFIG_NET=y
CONFIG_BINFMT_ELF=y
CONFIG_HOSTFS=y
CONFIG_NEST_LEVEL=0
CONFIG_KERNEL_HALF_GIGS=1
CONFIG_KERNEL_STACK_ORDER=2
CONFIG_CLEAN_COMPILE=y
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_SYSCTL=y
CONFIG_KOBJECT_UEVENT=y
CONFIG_KALLSYMS=y
CONFIG_PRINTK=y
CONFIG_BUG=y
CONFIG_BASE_FULL=y
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
CONFIG_CC_ALIGN_FUNCTIONS=0
CONFIG_CC_ALIGN_LABELS=0
CONFIG_CC_ALIGN_LOOPS=0
CONFIG_CC_ALIGN_JUMPS=0
CONFIG_BASE_SMALL=0
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_STANDALONE=y
CONFIG_STDERR_CONSOLE=y
CONFIG_STDIO_CONSOLE=y
CONFIG_XTERM_CHAN=y
CONFIG_NOCONFIG_CHAN=y
CONFIG_CON_ZERO_CHAN="fd:0,fd:1"
CONFIG_CON_CHAN="xterm"
CONFIG_SSL_CHAN="pty"
CONFIG_UNIX98_PTYS=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_INITRAMFS_SOURCE=""
CONFIG_LBD=y
CONFIG_IOSCHED_NOOP=y
CONFIG_NETDEVICES=y
CONFIG_EXT3_FS=y
CONFIG_JBD=y
CONFIG_DNOTIFY=y
CONFIG_PROC_FS=y
CONFIG_SYSFS=y
CONFIG_RAMFS=y
CONFIG_MSDOS_PARTITION=y
CONFIG_LOG_BUF_SHIFT=14

#7 lore raw
In reply to Antoine Martin
Quoted 3 lines · Antoine Martin

Host is running 2.6.13.1

I tried mode=skas0 but it seems to always default to TT.

The correct switch is skas0, mode=skas0 doesn't exist (maybe to fix). Just verified looking at vmlinux --help output.

Quoted 1 line

Or has this not been merged in mainline yet?

The only idea I can have about this is that you didn't compile skas mode in at all. Which makes sense since you never ran a x86_64 SKAS guest until skas0 was born.

In fact,if you have both TT and SKAS0 in, it by default chooses always skas0, unless you say mode=tt.

If you can verify (on *that* kernel, with --showconfig) it's not your fault, I'll check the sources.

Signature · 21 lines
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



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel