Bug 225583

Summary: UML on FC6 fails because of utrace patch
Product: [Fedora] Fedora Reporter: JuanJo Ciarlante <jjo>
Component: kernelAssignee: Roland McGrath <roland>
Status: CLOSED WORKSFORME QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: cebbert, davej, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-09-04 20:45:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description JuanJo Ciarlante 2007-01-31 14:51:05 UTC
Description of problem:
Running any user-mode-linux kernel (did try self compiled 2.6.17 and dloaded
2.6.18, 2.6.19.2 umls) fails: it boots and stops responding after 
"VFS: Mounted root (ext3 filesystem) readonly."

I tracked back and narrowed the kernel versions where the problem
started to show:
   OK:  kernel-smp-2.6.17-1.2187_FC5 (last FC5 upd. kernel I know to run ok)
   BAD: kernel-smp-2.6.18-1.2239.fc5 (IIRC 1st non-working FC5 kernel)
   BAD: kernel-2.6.19-1.2895.fc6     (current FC6 kernel)

Note: this is a FC6 uptodate distro, booted with these 3 diff. kernels.
Because those FC5 kernels have same selinux policyversion , FC6 "environment"
runs ok AFAICT.

To see at least if the command gets "enough" CPU to halt the UML, I tried:     
                           
 ./linux init=/sbin/halt -f                                                    
                            
                                                                               
                              
It didn't, "ps lx" on the host shows:                                          
                           
   $ ps lx                                                                     
                              
   0 240 4284 4152 15 0 33000 11000 - R+ pts/1 3:31 ./linux (Jj9kkn) /sbin/halt]
                            
   1 240 4293 4284 25 0 33000 11000 - S+ pts/1 0:00 ./linux (Jj9kkn) /sbin/halt]
                            
   1 240 4294 4284 24 0 33000 11000 - S+ pts/1 0:00 ./linux (Jj9kkn) /sbin/halt]
                            
   1 240 4295 4284 15 0 33000 11000 - S+ pts/1 0:00 ./linux (Jj9kkn) /sbin/halt]
                            
   1 240 4296 4284 15 0 60 56 -  R+ pts/1 2:42 [linux]                         
                               
, where cpu time for those "R+" procs almost equals wall time;                 
                           
                                                                               
                              
strace'ing repeats eternally these lines:                                      
                           
   $ strace -p 4284                                                            
                              
   -- SIGCHLD (Child exited) @ 0 (0) ---                                       
                              
   waitpid(4296, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGSEGV}], WSTOPPED) = 4296 
                              
   ptrace(PTRACE_GETREGS, 4296, 0, 0xa06ab82c) = 0                             
                              
   ptrace(PTRACE_GETFPXREGS, 4296, 0, 0xa06ab8dc) = 0                          
                              
   ptrace(PTRACE_CONT, 4296, 0, SIGSEGV) = 0                                   
                              
   :                                                                           
                              
   :                       

Version-Release number of selected component (if applicable):
kernel-2.6.19-1.2895.fc6

How reproducible:
Check that you are running a stock FC6 kernel
Compile or download an UML guest kernel (eg: http://uml.nagafix.co.uk/)
and any root_fs image, boot UML: it will stop after VFS mount.

Steps to Reproduce:
1. Download/compile UML guest kernel, eg: 
   set -e
   wget http://uml.nagafix.co.uk/kernels/kernel32-2.6.19.2
   mv kernel32-2.6.19.2 linux
   chmod +x linux

2. Download/build UML guest root_fs, eg: 
   wget http://uml.nagafix.co.uk/DSL-2.2/DSL-2.2-root_fs.bz2
   bunzip2 DSL-2.2-root_fs.bz2
   mv DSL-2.2-root_fs root_fs

3. ./linux
  
Actual results:
UML stops actually running after:
"VFS: Mounted root (ext3 filesystem) readonly."

Expected results:
To continue normal guest boot (run /sbin/init)

Additional info:
I've posted the FULL report uml-users mailing list:
http://sourceforge.net/mailarchive/forum.php?thread_id=31527621&forum_id=3647

Comment 1 JuanJo Ciarlante 2007-01-31 14:53:05 UTC
I forgot metioning I did more testing:

I did the following tests, based on released utrace patch (OK means UML runs
w/no problem, BAD means UML stops after VFS root mounting )
#1 2.6.18.6 vanilla: OK
#2 2.6.18.6+utrace,CONFIG_{UP}TRACE=y    : BAD (same behaviour as FC6 stock kernel)
#3 2.6.18.6+utrace,CONFIG_{UP}TRACE unset: BAD (idem)

Curiously, #3 did the very same as #2 (even wrt strace process disposition
and strace "behaviour"), I'd expected #3 to simply fail at boot with
EINVAL or alike (given that no ptrace support was compiled in).

Regards

Comment 2 Roland McGrath 2007-02-06 05:12:14 UTC
Would it be possible for you to test against vanilla 2.6.20?
The utrace patches in http://redhat.com/~roland/utrace/2.6-current/ are now
against 2.6.20, and have some fixes not in the 2.6.18 backport.  If utrace is
breaking UML, I'll need to debug it against the current kernel.

Comment 3 JuanJo Ciarlante 2007-02-06 20:22:05 UTC
I've tested against 2.6.20: SAME (bad) behaviour as 2.6.18.6.

FYI ss with previous kernels, I've downloaded  2.6.20 vanilla, copied .config
make && make install && boot ; later applied utrace patch , edited EXTRA_VERSION
&& ... && boot.


Comment 4 Mark Wielaard 2007-03-08 22:50:32 UTC
According to Jeff Dike "UML runs on the utrace in -mm (i.e. utrace on the host),
which it didn't with several Fedora kernels."
http://lkml.org/lkml/2007/2/20/299

Comment 5 Roland McGrath 2007-03-08 22:52:56 UTC
Indeed, apparently problems with UML are now seen only on a CONFIG_PREEMPT=y
kernel, which Fedora does not ship.  However, it may be only the luck of the
timing, as the bug biting UML was never isolated.

Comment 6 Roland McGrath 2007-09-04 20:45:23 UTC
Several old bugs that might have affected this have been fixed.  Reopen if the
problem reoccurs.