Bug 131195

Summary: Mkinitrd hangs after "Switching to new root"
Product: [Fedora] Fedora Reporter: W. Michael Petullo <redhat>
Component: mkinitrdAssignee: Jeremy Katz <katzj>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: powerpc   
OS: Linux   
Fixed In Version: mkinitrd-4.1.11-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-09-12 02:38:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 123268    

Description W. Michael Petullo 2004-08-28 21:32:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.7.2)
Gecko/20040809 Epiphany/1.3.5

Description of problem:
After using mkinitrd-4.1.8-1 to create an initrd, my system hangs
following "Switching to new root" message.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Install mkinitrd-4.1.8-1.
2.  Regenerate my initrd.
3.  Reboot.

Actual Results:  System hangs.  I added some printfs to nash and the
hang seems to happen inside the getKernelCmdLine() function that is
called by switchrootCommand().  The hang happens immediately following
"buf = malloc(CMDLINESIZE);"

The getKernelCmdLine() function is also called earlier by the
mkrootdevCommand(), which does not have any trouble.

Perhaps there is some type of heap corruption that is causing "buf =
malloc(CMDLINESIZE);" to die.

I would love to run nash through valgrind but I don't have an x86 machine.

Additional info:

Comment 1 W. Michael Petullo 2004-08-28 21:39:32 UTC
I should have been more clear that I am having this problem on a
PowerPC-based iBook.

Comment 2 W. Michael Petullo 2004-09-03 21:55:30 UTC
It seems that the definition of CMDLINESIZE may cause this.  Nash.c
defines CMDLINESIZE like this:

#ifdef __powerpc__
#define CMDLINESIZE 256
#define CMDLINESIZE 1024

However, the kernel's include/asm-ppc/setup.h defines

When I change CMDLINESIZE from 256 to 512, I don't have any trouble.  

The odd thing is that the read call only reads 31 bytes of command
line on my system.  I don't see why changing CMDLINESIZE from 256 to
512 would fix things but it seems to.  I'm still not convinced there
isn't some memory issue elsewhere.

Comment 3 Jeremy Katz 2004-09-10 21:30:54 UTC
Found one little thing with valgrind, it's in 4.1.11 (maybe it'll help...)

Could you try with 4.1.11 (http://people.redhat.com/~katzj/mkinitrd/
will have the package when it's done) and see if that helps?

Comment 4 W. Michael Petullo 2004-09-12 02:38:41 UTC
4.1.11's nash no longer hangs as described above.