Bug 88594 - mkinitrd-3.4.43-1 incompatible with gawk-3.1.2-1 -- fails to detect RAID devices
mkinitrd-3.4.43-1 incompatible with gawk-3.1.2-1 -- fails to detect RAID devices
Product: Red Hat Raw Hide
Classification: Retired
Component: gawk (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Florian La Roche
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2003-04-11 02:50 EDT by Jonathan Kamens
Modified: 2007-04-18 12:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-04-15 04:42:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
feed /proc/mdstat into awk with cat (707 bytes, patch)
2003-04-11 02:51 EDT, Jonathan Kamens
no flags Details | Diff

  None (edit)
Description Jonathan Kamens 2003-04-11 02:50:30 EDT
/sbin/mkinitrd in mkinitrd-3.4.43-1 contains code that looks like this:

  awk '/^md[0-9][0-9]*[ 	]*:/ { print $4 }' /proc/mdstat

Unfortunately, it appears that the version of awk in gawk-3.1.2-1 refuses to
read any data from a file if stat on the file returns a size of 0:

  $ awk '/^md[0-9][0-9]*[       ]*:/ { print $4 }' /proc/mdstat
  $ cat /proc/mdstat | awk '/^md[0-9][0-9]*[    ]*:/ { print $4 }'  

Now, it could be argued that this is a bug in gawk, and indeed, I think I'll
file a bug report about it, but still, I think it would be best for mkinitrd to
be resilient in the face of this problem by using the "cat" technique shown
above.  I'll attach a patch.
Comment 1 Jonathan Kamens 2003-04-11 02:51:05 EDT
Created attachment 91071 [details]
feed /proc/mdstat into awk with cat
Comment 2 Jeremy Katz 2003-04-11 14:22:26 EDT
No, this is gawk being busted and needing to be fixed, not something that should
be worked around in mkinitrd
Comment 3 Florian La Roche 2003-04-15 04:42:11 EDT
3.1.2-2 has a fix in it. Please reopen if that does not work for you.

Thanks a lot for this bug-report,

Florian La Roche

Note You need to log in before you can comment on or make changes to this bug.