Bug 88595 - gawk-3.1.2-1 won't read special device which stat() says is empty
gawk-3.1.2-1 won't read special device which stat() says is empty
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: gawk (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Florian La Roche
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-11 02:53 EDT by Jonathan Kamens
Modified: 2007-04-18 12:52 EDT (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2003-04-11 02:53:35 EDT
jik:~!1021$ rpm -q gawk
gawk-3.1.2-1
jik:~!1022$ stat /proc/mdstat
  File: `/proc/mdstat'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 2h/2d   Inode: 4468        Links: 1    
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2003-04-11 02:52:24.000000000 -0400
Modify: 2003-04-11 02:52:24.000000000 -0400
Change: 2003-04-11 02:52:24.000000000 -0400

jik:~!1023$ cat /proc/mdstat | awk '{print}'
Personalities : [raid1] 
read_ahead 1024 sectors
md0 : active raid1 [dev 08:05][1] hde6[0]
      2305152 blocks [2/2] [UU]
      
md1 : active raid1 [dev 08:06][1] hdg4[0]
      4096448 blocks [2/2] [UU]
      
md2 : active raid1 [dev 08:07][1] hdg3[0]
      264960 blocks [2/2] [UU]
      
md3 : active raid1 [dev 08:08][1] hdg1[0]
      3140608 blocks [2/2] [UU]
      
unused devices: <none>
jik:~!1024$ awk '{print}' /proc/mdstat
jik:~!1025$ 

Awk is being too smart here.  If the file it's told to read is a device rather
than a regular file, it shouldn't pay attention to the size indicated in the
stat() structure for the file -- it should just open the file and try to read it
until it gets EOF.
Comment 1 Florian La Roche 2003-04-11 14:51:08 EDT
This is no device, but marked as regular file.

Florian La Roche
Comment 2 Florian La Roche 2003-04-15 04:43:34 EDT
Fixed in gawk-3.1.2-2, soon in rawhide.

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.