All of lore.kernel.org
 help / color / mirror / Atom feed
* PROBLEM: fstat(2) returns st_size==0 for non-empty FIFO.
@ 2008-09-09 23:05 John Wenker
  2008-09-10  9:19 ` Alejandro Riveira Fernández
  2008-09-10  9:24 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: John Wenker @ 2008-09-09 23:05 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 7955 bytes --]

A colleague has run into a problem.  We assume it's a kernel issue.  Here 
is the pertinent bug report data.

[1.] One line summary of the problem:
fstat(2) returns st_size == 0 for a FIFO that is known to have data in it.

[2.] Full description of the problem/report:
When using a FIFO, fstat(2) (and stat(2)) returns a 'struct stat' with the 
st_size field equal to zero, at a time when the FIFO is known to have data 
in it.  Problem occurs with Linux 2.6.16 kernel (see more below), but does 
not occur on 2.4.20.

[3.] Keywords (i.e., modules, networking, kernel):
stat, fstat, FIFO, struct stat, st_size, system call, write

[4.] Kernel version (from /proc/version):
Linux version 2.6.16.13-4-default (geeko@buildhost) (gcc version 4.1.0 
(SUSE Linux)) #1 Wed May 3 04:53:23 UTC 2006

Note: Problem does _not_ occur on Linux version 2.4.20-8 
(bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 2003022 (Red Hat 
Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003

[5.] Output of Oops.. message (if applicable) with symbolic information 
     resolved (see Documentation/oops-tracing.txt)
No oops.  Problem doesn't cause system crash, only affects behavior of 
user applications.

[6.] A small shell script or example program which triggers the
     problem (if possible)
I don't know if this qualifies as "small", but there is a 'C' program 
attached that will reproduce the problem (fifo.c).



[7.] Environment
[7.1.] Software (add the output of the ver_linux script here)
See attached file (ver-linux.out).



[7.2.] Processor information (from /proc/cpuinfo):
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 79
model name      : AMD Athlon(tm) 64 Processor 3500+
stepping        : 2
cpu MHz         : 1000.000
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 
3dnowext 3dnow pni cx16 lahf_lm svm cr8_legacy
bogomips        : 2007.28
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc


[7.3.] Module information (from /proc/modules):
nfs 210744 4 - Live 0xffffffff8826f000
lockd 70256 2 nfs, Live 0xffffffff8825c000
nfs_acl 4096 1 nfs, Live 0xffffffff8814a000
sunrpc 152392 4 nfs,lockd,nfs_acl, Live 0xffffffff88235000
af_packet 22028 0 - Live 0xffffffff8822e000
ipv6 252000 12 - Live 0xffffffff881ef000
cpufreq_ondemand 6956 1 - Live 0xffffffff881ec000
cpufreq_userspace 4500 0 - Live 0xffffffff881e9000
cpufreq_powersave 2176 0 - Live 0xffffffff88075000
powernow_k8 10512 0 - Live 0xffffffff881e5000
freq_table 5128 1 powernow_k8, Live 0xffffffff881e2000
edd 10504 0 - Live 0xffffffff881de000
snd_pcm_oss 49024 0 - Live 0xffffffff881d1000
snd_mixer_oss 18304 1 snd_pcm_oss, Live 0xffffffff881cb000
snd_seq 55712 0 - Live 0xffffffff881bc000
snd_seq_device 9360 1 snd_seq, Live 0xffffffff881b8000
button 7968 0 - Live 0xffffffff881b5000
battery 11016 0 - Live 0xffffffff881b1000
ac 5896 0 - Live 0xffffffff881ae000
apparmor 53540 0 - Live 0xffffffff8819f000
aamatch_pcre 14464 1 apparmor, Live 0xffffffff8819a000
loop 16016 0 - Live 0xffffffff88195000
dm_mod 59976 0 - Live 0xffffffff88185000
ohci_hcd 19460 0 - Live 0xffffffff8817f000
ehci_hcd 30216 0 - Live 0xffffffff88174000
usbcore 130600 3 ohci_hcd,ehci_hcd, Live 0xffffffff88153000
forcedeth 23684 0 - Live 0xffffffff8814c000
snd_hda_intel 19228 0 - Live 0xffffffff88144000
snd_hda_codec 172800 1 snd_hda_intel, Live 0xffffffff88118000
ide_cd 40480 0 - Live 0xffffffff8810d000
cdrom 36008 1 ide_cd, Live 0xffffffff88103000
snd_pcm 97292 3 snd_pcm_oss,snd_hda_intel,snd_hda_codec, Live 
0xffffffff880ea000
snd_timer 24968 2 snd_seq,snd_pcm, Live 0xffffffff880e2000
snd 65192 8 
snd_pcm_oss,snd_mixer_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer, 
Live 0xffffffff880d1000
soundcore 10656 1 snd, Live 0xffffffff880cd000
snd_page_alloc 10640 2 snd_hda_intel,snd_pcm, Live 0xffffffff880c9000
reiserfs 222464 2 - Live 0xffffffff88091000
fan 5640 0 - Live 0xffffffff8808e000
thermal 15888 0 - Live 0xffffffff88089000
processor 26068 2 powernow_k8,thermal, Live 0xffffffff88081000
sg 35240 0 - Live 0xffffffff88077000
sata_nv 10628 3 - Live 0xffffffff88071000
libata 74136 1 sata_nv, Live 0xffffffff8805d000
amd74xx 15024 0 [permanent], Live 0xffffffff88058000
sd_mod 17688 4 - Live 0xffffffff88052000
scsi_mod 145328 3 sg,libata,sd_mod, Live 0xffffffff8802d000
ide_disk 16512 0 - Live 0xffffffff88027000
ide_core 145380 3 ide_cd,amd74xx,ide_disk, Live 0xffffffff88002000

[7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
0000-001f : dma1
0020-0021 : pic1
0040-0043 : timer0
0050-0053 : timer1
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
0376-0376 : ide1
03c0-03df : vesafb
0960-0967 : 0000:00:0f.0
  0960-0967 : sata_nv
0970-0977 : 0000:00:0e.0
  0970-0977 : sata_nv
09e0-09e7 : 0000:00:0f.0
  09e0-09e7 : sata_nv
09f0-09f7 : 0000:00:0e.0
  09f0-09f7 : sata_nv
0b60-0b63 : 0000:00:0f.0
  0b60-0b63 : sata_nv
0b70-0b73 : 0000:00:0e.0
  0b70-0b73 : sata_nv
0be0-0be3 : 0000:00:0f.0
  0be0-0be3 : sata_nv
0bf0-0bf3 : 0000:00:0e.0
  0bf0-0bf3 : sata_nv
0cf8-0cff : PCI conf1
2000-207f : motherboard
2080-20ff : motherboard
4000-407f : motherboard
  4000-4003 : PM1a_EVT_BLK
  4004-4005 : PM1a_CNT_BLK
  4008-400b : PM_TMR
  401c-401c : PM2_CNT_BLK
  4020-4027 : GPE0_BLK
4080-40ff : motherboard
4400-447f : motherboard
4480-44ff : motherboard
  44a0-44af : GPE1_BLK
4800-487f : motherboard
4880-48ff : motherboard
4c00-4c3f : 0000:00:0a.1
4c40-4c7f : 0000:00:0a.1
9000-9fff : PCI Bus #02
a000-afff : PCI Bus #03
  ac00-acff : 0000:03:08.0
b000-bfff : PCI Bus #01
c800-c807 : 0000:00:14.0
  c800-c807 : forcedeth
cc00-cc0f : 0000:00:0f.0
  cc00-cc0f : sata_nv
e000-e00f : 0000:00:0e.0
  e000-e00f : sata_nv
f400-f40f : 0000:00:0d.0
  f400-f407 : ide0
  f408-f40f : ide1

00000000-0009f7ff : System RAM
  00000000-00000000 : Crash kernel
0009f800-0009ffff : reserved
000a0000-000bffff : Video RAM area
000c0000-000cebff : Video ROM
000f0000-000fffff : System ROM
00100000-1beeffff : System RAM
  00100000-002b0381 : Kernel code
  002b0382-0037020f : Kernel data
1bef0000-1bef2fff : ACPI Non-volatile Storage
1bef3000-1befffff : ACPI Tables
1c000000-1fffffff : reserved
30000000-3001ffff : 0000:00:05.0
e0000000-efffffff : 0000:00:05.0
  e0000000-e3ffffff : vesafb
f0000000-f3ffffff : reserved
fa000000-faffffff : 0000:00:05.0
fb000000-fbffffff : 0000:00:05.0
fc800000-fd7fffff : PCI Bus #03
  fc800000-fcffffff : 0000:03:08.0
  fd7ff000-fd7ff1ff : 0000:03:08.0
fda00000-fdafffff : PCI Bus #02
fdb00000-fdbfffff : PCI Bus #02
fdc00000-fdcfffff : PCI Bus #01
fdd00000-fddfffff : PCI Bus #03
fde00000-fdefffff : PCI Bus #01
fe024000-fe027fff : 0000:00:10.1
  fe024000-fe027fff : ICH HD audio
fe02b000-fe02bfff : 0000:00:14.0
  fe02b000-fe02bfff : forcedeth
fe02c000-fe02cfff : 0000:00:0f.0
  fe02c000-fe02cfff : sata_nv
fe02d000-fe02dfff : 0000:00:0e.0
  fe02d000-fe02dfff : sata_nv
fe02e000-fe02e0ff : 0000:00:0b.1
  fe02e000-fe02e0ff : ehci_hcd
fe02f000-fe02ffff : 0000:00:0b.0
  fe02f000-fe02ffff : ohci_hcd
fec00000-ffffffff : reserved

[7.5.] PCI information ('lspci -vvv' as root)
See attached file (lspci.out).



[7.6.] SCSI information (from /proc/scsi/scsi)
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: ST3160812AS      Rev: 3.AH
  Type:   Direct-Access                    ANSI SCSI revision: 05

[7.7.] Other information that might be relevant to the problem
       (please look in /proc and include all information that you
       think to be relevant):
None.

[X.] Other notes, patches, fixes, workarounds:
None.

Thank you!

John Wenker
jjw@pt.com

[-- Attachment #2: fifo.c --]
[-- Type: application/octet-stream, Size: 7194 bytes --]

#include <errno.h>      /* errno                              */
#include <fcntl.h>      /* O_RDONLY et al.                    */
#include <signal.h>     /* SIGKILL, etc.                      */
#include <stdio.h>      /* printf, fprintf, EOF, etc.         */
#include <stdlib.h>     /* exit(3).                           */
#include <string.h>     /* strlen(3), strrchr(3), etc.        */
#include <sys/stat.h>   /* fstat(2)                           */
#include <sys/wait.h>   /* wait(2)                            */
#include <unistd.h>     /* open(2), close(2), getopt(3), etc. */


/*
** Constants.
*/
#define BFRSZ        256
#define INVALID_DESC  -1


/*
** Macro to terminate program on failed system call.
*/
#define SYSCALL(expr)                                                \
        do                                                           \
        {                                                            \
           if ( (expr) == -1 )                                       \
           {                                                         \
              int _err = errno;                                      \
              fprintf( stderr,                                       \
                       "%s (line %d): %s.\n",                        \
                       pgmName,                                      \
                       __LINE__,                                     \
                       strerror( _err ) );                           \
              kill( 0, SIGKILL );   /* Terminate process group. */   \
           }                                                         \
        } while ( 0 )

/*
** Usage macro.
*/
#define VALIDOPTS ":v"
#define USAGE()                              \
        do                                   \
        {                                    \
           fprintf( stderr,                  \
                    "Usage: %s [-v] path\n", \
                    pgmName );               \
           exit( 127 );                      \
        } while ( 0 )




/*
** Main program.  Write into a FIFO, and then call fstat(2) to determine the
** amount written.  Unfortunately, due to the rules defining how FIFOs are
** opened, this program is somewhat more complicated than it should be; i.e. it
** forks a child process to handle one end of the pipe.
*/
int main( int   argc,
          char *argv[ ] )
{
   char          bfr[ BFRSZ ];
   int           fifoRead = INVALID_DESC;
   int           fifoWrite;
   struct stat   info;
   int           opt;
   pid_t         pid;
   char         *pgmName;
   size_t        sz;
   int           verbose = 0;

   /*
   ** Set program name (w/o directory prefix).
   */
   pgmName = strrchr( argv[ 0 ], '/' );
   pgmName = pgmName == NULL  ?  argv[ 0 ]  :  pgmName+1;

   /*
   ** Process command options.
   */
   while ( ( opt = getopt( argc, argv, VALIDOPTS ) ) != EOF )
   {
      switch ( opt )
      {
         case 'v':   /* Verbose mode. */
            verbose = 1;
            break;

         default:
            USAGE( );   /* Terminates program. */
      }  /* End SWITCH on command option. */
   }  /* End WHILE processing command options. */

   /*
   ** Check command line arguments.
   */
   if ( argc != ( optind+1 ) )
   {
      USAGE( );   /* Terminates program. */
   }

   /*
   ** Create the FIFO.
   */
   if ( verbose ) fprintf( stderr, "Creating FIFO...\n" );
   if ( ( mknod( argv[ 1 ], S_IFIFO | 0666, 0 ) < 0 ) &&
        ( errno != EEXIST ) )
   {
      SYSCALL( -1 );   /* Force error termination. */
   }

   /*
   ** Main loop.  The child process writes into the FIFO, and the parent reads
   ** it, based on info from fstat(2).
   */
   do
   {
      /*
      ** Fork a child to write to the FIFO.  Note this is a new child with each
      ** loop iteration (makes it easy for the parent to sync up).
      */
      SYSCALL( pid = fork( ) );

      if ( pid == 0 )   /* Child process. */
      {
         /*
         ** Open FIFO for writing.
         */
         if ( verbose ) fprintf( stderr, "Opening FIFO for writing...\n" );
         SYSCALL( fifoWrite = open( argv[ 1 ], O_WRONLY ) );

         /*
         ** Read a line of input from the user.
         */
         fprintf( stderr, "Enter a string to write into the FIFO: " );
         errno = 0;      /* To differentiate between EOF and error. */
         if ( fgets( bfr, BFRSZ, stdin ) == NULL )
         {
            if ( errno != 0 )
            {
               SYSCALL( -1 );   /* Root out the underlying system error. */
            }
            /*
            ** You'd think fgets(3) would stick an ASCII NUL into the buffer on
            ** EOF like it does normally, but apparently it doesn't!  So
            ** explicitly add it manually.  This causes a null string to be
            ** written to the FIFO when EOF occurs (i.e. one NUL character).
            */
            *bfr = '\0';
         }  /* End IF fgets(3) returned NULL. */

         /*
         ** Write the FIFO and terminate the child process.
         */
         sz = strlen( bfr ) + 1;   /* +1 for null terminator. */
         if ( sz == BFRSZ )
         {
            /*
            ** Buffer is full.  The user _may_ (not necessarily) have entered a
            ** string that is too long for the buffer and was truncated.  Force
            ** a newline at the end just in case.  [Not to be confused with the
            ** '\0' end-of-string.]  The tail end of the string is lost when
            ** the child process terminates.
            */
            bfr[ sz-2 ] = '\n';
         }  /* End IF buffer full. */
         if ( verbose )
         {
            fprintf( stderr,
                     "Child writing %u bytes into FIFO...\n",
                     sz );
         }
         SYSCALL( write( fifoWrite, bfr, sz ) );
         SYSCALL( fstat( fifoWrite, &info ) );
         if ( info.st_size != sz )
         {
            fprintf( stderr,
                     "%s: WARNING - %lu (of %u requested) bytes "
                     "written into FIFO.\n",
                     pgmName,
                     info.st_size,
                     sz );
         }
         SYSCALL( close( fifoWrite ) );
         exit( 0 );
      }  /* End IF child process. */

      /*
      ** Parent process.  Open the FIFO for reading (if not already open).
      */
      if ( fifoRead == INVALID_DESC )
      {
         if ( verbose ) fprintf( stderr, "Opening FIFO for reading...\n" );
         SYSCALL( fifoRead = open( argv[ 1 ], O_RDONLY ) );
      }

      /*
      ** Wait for the child to write the pipe.
      */
      wait( NULL );

      /*
      ** Read in from the pipe.  fstat(2) tells the number of bytes to read
      ** (i.e. the amount of data in the pipe).
      */
      SYSCALL( fstat( fifoRead, &info ) );
      printf( "%lu bytes in FIFO.\n", info.st_size );
      *bfr = '\0';   /* In case fstat(2) messes up (st_size == 0). */
      SYSCALL( read( fifoRead, bfr, info.st_size ) );
      fputs( bfr, stdout );
   } while ( info.st_size > 1 );   /* 1 = EOF; 0 = child error termination. */
   SYSCALL( close( fifoRead ) );
   return 0;
}  /* End main() */

[-- Attachment #3: ver_linux.out --]
[-- Type: application/octet-stream, Size: 1341 bytes --]

If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.
 
Linux killian 2.6.16.13-4-default #1 Wed May 3 04:53:23 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
 
Gnu C                  4.1.0
Gnu make               3.80
binutils               2.16.91.0.5
util-linux             2.12r
mount                  2.12r
module-init-tools      3.2.2
e2fsprogs              1.38
jfsutils               1.1.10
reiserfsprogs          3.6.19
reiser4progs           line
xfsprogs               2.7.11
quota-tools            3.13.
PPP                    2.4.3
nfs-utils              1.0.7
Linux C Library        > libc.2.4
Dynamic linker (ldd)   2.4
Linux C++ Library      6.0.8
Procps                 3.2.6
Net-tools              1.60
Kbd                    1.12
Sh-utils               5.93
udev                   085
Modules Loaded         nfs lockd nfs_acl sunrpc af_packet ipv6 cpufreq_ondemand cpufreq_userspace cpufreq_powersave powernow_k8 freq_table edd snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device button battery ac apparmor aamatch_pcre loop dm_mod ohci_hcd ehci_hcd usbcore forcedeth snd_hda_intel snd_hda_codec ide_cd cdrom snd_pcm snd_timer snd soundcore snd_page_alloc reiserfs fan thermal processor sg sata_nv libata amd74xx sd_mod scsi_mod ide_disk ide_core

[-- Attachment #4: lspci.out --]
[-- Type: application/octet-stream, Size: 19332 bytes --]

00:00.0 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0
	Capabilities: [44] HyperTransport: Slave or Primary Interface
		Command: BaseUnitID=0 UnitCnt=15 MastHost- DefDir- DUL-
		Link Control 0: CFlE+ CST- CFE- <LkFail- Init+ EOC- TXO- <CRCErr=0 IsocEn- LSEn- ExtCTL- 64b-
		Link Config 0: MLWI=16bit DwFcIn- MLWO=16bit DwFcOut- LWI=16bit DwFcInEn- LWO=16bit DwFcOutEn-
		Link Control 1: CFlE+ CST- CFE- <LkFail- Init+ EOC- TXO- <CRCErr=0 IsocEn- LSEn+ ExtCTL- 64b-
		Link Config 1: MLWI=16bit DwFcIn- MLWO=16bit DwFcOut- LWI=8bit DwFcInEn- LWO=8bit DwFcOutEn-
		Revision ID: 1.03
		Link Frequency 0: 1.0GHz
		Link Error 0: <Prot- <Ovfl- <EOC- CTLTm-
		Link Frequency Capability 0: 200MHz+ 300MHz+ 400MHz+ 500MHz+ 600MHz+ 800MHz+ 1.0GHz+ 1.2GHz- 1.4GHz- 1.6GHz- Vend-
		Feature Capability: IsocFC+ LDTSTOP+ CRCTM- ECTLT- 64bA- UIDRD-
		Link Frequency 1: 800MHz
		Link Error 1: <Prot- <Ovfl- <EOC- CTLTm-
		Link Frequency Capability 1: 200MHz+ 300MHz+ 400MHz+ 500MHz+ 600MHz+ 800MHz+ 1.0GHz+ 1.2GHz- 1.4GHz- 1.6GHz- Vend-
		Error Handling: PFlE+ OFlE+ PFE- OFE- EOCFE- RFE- CRCFE- SERRFE- CF- RE- PNFE- ONFE- EOCNFE- RNFE- CRCNFE- SERRNFE-
		Prefetchable memory behind bridge Upper: 00-00
		Bus Number: 00
	Capabilities: [e0] HyperTransport: MSI Mapping

00:00.1 RAM memory: nVidia Corporation C51 Memory Controller 0 (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR+ <PERR-

00:00.2 RAM memory: nVidia Corporation C51 Memory Controller 1 (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:00.3 RAM memory: nVidia Corporation C51 Memory Controller 5 (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:00.4 RAM memory: nVidia Corporation C51 Memory Controller 4 (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0

00:00.5 RAM memory: nVidia Corporation C51 Host Bridge (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0
	Capabilities: [44] #00 [00fe]
	Capabilities: [fc] #00 [0000]

00:00.6 RAM memory: nVidia Corporation C51 Memory Controller 3 (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:00.7 RAM memory: nVidia Corporation C51 Memory Controller 2 (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:02.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1) (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0, Cache Line Size 08
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: 0000b000-0000bfff
	Memory behind bridge: fde00000-fdefffff
	Prefetchable memory behind bridge: 00000000fdc00000-00000000fdc00000
	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-
	Capabilities: [40] #0d [0000]
	Capabilities: [48] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable+
		Address: 00000000fee00000  Data: 40b9
	Capabilities: [60] HyperTransport: MSI Mapping
	Capabilities: [80] Express Root Port (Slot+) IRQ 0
		Device: Supported: MaxPayload 128 bytes, PhantFunc 0, ExtTag-
		Device: Latency L0s <512ns, L1 <4us
		Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-
		Device: RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
		Device: MaxPayload 128 bytes, MaxReadReq 512 bytes
		Link: Supported Speed 2.5Gb/s, Width x1, ASPM L0s L1, Port 2
		Link: Latency L0s <512ns, L1 <4us
		Link: ASPM Disabled RCB 64 bytes CommClk- ExtSynch-
		Link: Speed 2.5Gb/s, Width x1
		Slot: AtnBtn- PwrCtrl- MRL- AtnInd- PwrInd- HotPlug- Surpise-
		Slot: Number 0, PowerLimit 0.000000
		Slot: Enabled AtnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq-
		Slot: AttnInd Off, PwrInd On, Power-
		Root: Correctable- Non-Fatal- Fatal- PME-

00:04.0 PCI bridge: nVidia Corporation C51 PCI Express Bridge (rev a1) (prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0, Cache Line Size 08
	Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
	I/O behind bridge: 00009000-00009fff
	Memory behind bridge: fdb00000-fdbfffff
	Prefetchable memory behind bridge: 00000000fda00000-00000000fda00000
	Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-
	Capabilities: [40] #0d [0000]
	Capabilities: [48] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/1 Enable+
		Address: 00000000fee00000  Data: 40c1
	Capabilities: [60] HyperTransport: MSI Mapping
	Capabilities: [80] Express Root Port (Slot+) IRQ 0
		Device: Supported: MaxPayload 128 bytes, PhantFunc 0, ExtTag-
		Device: Latency L0s <512ns, L1 <4us
		Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-
		Device: RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
		Device: MaxPayload 128 bytes, MaxReadReq 512 bytes
		Link: Supported Speed 2.5Gb/s, Width x16, ASPM L0s L1, Port 0
		Link: Latency L0s <512ns, L1 <4us
		Link: ASPM Disabled RCB 64 bytes CommClk- ExtSynch-
		Link: Speed 2.5Gb/s, Width x16
		Slot: AtnBtn- PwrCtrl- MRL- AtnInd- PwrInd- HotPlug- Surpise-
		Slot: Number 0, PowerLimit 0.000000
		Slot: Enabled AtnBtn- PwrFlt- MRL- PresDet- CmdCplt- HPIrq-
		Slot: AttnInd Off, PwrInd On, Power-
		Root: Correctable- Non-Fatal- Fatal- PME-

00:05.0 VGA compatible controller: nVidia Corporation C51 PCI Express Bridge (rev a2) (prog-if 00 [VGA])
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0
	Interrupt: pin A routed to IRQ 5
	Region 0: Memory at fb000000 (32-bit, non-prefetchable) [size=16M]
	Region 1: Memory at e0000000 (64-bit, prefetchable) [size=256M]
	Region 3: Memory at fa000000 (64-bit, non-prefetchable) [size=16M]
	[virtual] Expansion ROM at 30000000 [disabled] [size=128K]
	Capabilities: [48] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
		Address: 0000000000000000  Data: 0000

00:09.0 RAM memory: nVidia Corporation MCP51 Host Bridge (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0
	Capabilities: [44] HyperTransport: Slave or Primary Interface
		Command: BaseUnitID=9 UnitCnt=15 MastHost- DefDir- DUL-
		Link Control 0: CFlE+ CST- CFE- <LkFail- Init+ EOC- TXO- <CRCErr=0 IsocEn- LSEn+ ExtCTL- 64b-
		Link Config 0: MLWI=8bit DwFcIn- MLWO=8bit DwFcOut- LWI=8bit DwFcInEn- LWO=8bit DwFcOutEn-
		Link Control 1: CFlE- CST- CFE- <LkFail+ Init- EOC+ TXO+ <CRCErr=0 IsocEn- LSEn- ExtCTL- 64b-
		Link Config 1: MLWI=8bit DwFcIn- MLWO=8bit DwFcOut- LWI=8bit DwFcInEn- LWO=8bit DwFcOutEn-
		Revision ID: 1.03
		Link Frequency 0: 800MHz
		Link Error 0: <Prot- <Ovfl- <EOC- CTLTm-
		Link Frequency Capability 0: 200MHz+ 300MHz+ 400MHz+ 500MHz+ 600MHz+ 800MHz+ 1.0GHz+ 1.2GHz- 1.4GHz- 1.6GHz- Vend-
		Feature Capability: IsocFC+ LDTSTOP+ CRCTM- ECTLT- 64bA- UIDRD-
		Link Frequency 1: 200MHz
		Link Error 1: <Prot- <Ovfl- <EOC- CTLTm-
		Link Frequency Capability 1: 200MHz- 300MHz- 400MHz- 500MHz- 600MHz- 800MHz- 1.0GHz- 1.2GHz- 1.4GHz- 1.6GHz- Vend-
		Error Handling: PFlE+ OFlE+ PFE- OFE- EOCFE- RFE- CRCFE- SERRFE- CF- RE- PNFE- ONFE- EOCNFE- RNFE- CRCNFE- SERRNFE-
		Prefetchable memory behind bridge Upper: 00-00
		Bus Number: 00
	Capabilities: [e0] HyperTransport: MSI Mapping

00:0a.0 ISA bridge: nVidia Corporation MCP51 LPC Bridge (rev a3)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0

00:0a.1 SMBus: nVidia Corporation MCP51 SMBus (rev a3)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Interrupt: pin A routed to IRQ 255
	Region 4: I/O ports at 4c00 [size=64]
	Region 5: I/O ports at 4c40 [size=64]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0a.2 RAM memory: nVidia Corporation MCP51 Memory Controller 0 (rev a3)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:0b.0 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3) (prog-if 10 [OHCI])
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (750ns min, 250ns max)
	Interrupt: pin A routed to IRQ 209
	Region 0: Memory at fe02f000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0b.1 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3) (prog-if 20 [EHCI])
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (750ns min, 250ns max)
	Interrupt: pin B routed to IRQ 201
	Region 0: Memory at fe02e000 (32-bit, non-prefetchable) [size=256]
	Capabilities: [44] Debug port
	Capabilities: [80] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0d.0 IDE interface: nVidia Corporation MCP51 IDE (rev a1) (prog-if 8a [Master SecP PriP])
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (750ns min, 250ns max)
	Region 4: I/O ports at f400 [size=16]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:0e.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1) (prog-if 85 [Master SecO PriO])
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (750ns min, 250ns max)
	Interrupt: pin A routed to IRQ 201
	Region 0: I/O ports at 09f0 [size=8]
	Region 1: I/O ports at 0bf0 [size=4]
	Region 2: I/O ports at 0970 [size=8]
	Region 3: I/O ports at 0b70 [size=4]
	Region 4: I/O ports at e000 [size=16]
	Region 5: Memory at fe02d000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [b0] Message Signalled Interrupts: 64bit+ Queue=0/2 Enable-
		Address: 0000000000000000  Data: 0000
	Capabilities: [cc] HyperTransport: MSI Mapping

00:0f.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1) (prog-if 85 [Master SecO PriO])
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (750ns min, 250ns max)
	Interrupt: pin A routed to IRQ 209
	Region 0: I/O ports at 09e0 [size=8]
	Region 1: I/O ports at 0be0 [size=4]
	Region 2: I/O ports at 0960 [size=8]
	Region 3: I/O ports at 0b60 [size=4]
	Region 4: I/O ports at cc00 [size=16]
	Region 5: Memory at fe02c000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [b0] Message Signalled Interrupts: 64bit+ Queue=0/2 Enable-
		Address: 0000000000000000  Data: 0000
	Capabilities: [cc] HyperTransport: MSI Mapping

00:10.0 PCI bridge: nVidia Corporation MCP51 PCI Bridge (rev a2) (prog-if 01 [Subtractive decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0
	Bus: primary=00, secondary=03, subordinate=03, sec-latency=128
	I/O behind bridge: 0000a000-0000afff
	Memory behind bridge: fc800000-fd7fffff
	Prefetchable memory behind bridge: fdd00000-fddfffff
	Secondary status: 66MHz- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- <SERR- <PERR-
	BridgeCtl: Parity- SERR- NoISA+ VGA- MAbort- >Reset- FastB2B-
	Capabilities: [b8] #0d [0000]
	Capabilities: [8c] HyperTransport: MSI Mapping

00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (500ns min, 1250ns max)
	Interrupt: pin B routed to IRQ 217
	Region 0: Memory at fe024000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [50] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable-
		Address: 0000000000000000  Data: 0000
	Capabilities: [6c] HyperTransport: MSI Mapping

00:14.0 Bridge: nVidia Corporation MCP51 Ethernet Controller (rev a3)
	Subsystem: Hewlett-Packard Company Unknown device 2a45
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 0 (250ns min, 5000ns max)
	Interrupt: pin A routed to IRQ 225
	Region 0: Memory at fe02b000 (32-bit, non-prefetchable) [size=4K]
	Region 1: I/O ports at c800 [size=8]
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable+ DSel=0 DScale=0 PME-

00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Capabilities: [80] HyperTransport: Host or Secondary Interface
		!!! Possibly incomplete decoding
		Command: WarmRst+ DblEnd-
		Link Control: CFlE- CST- CFE- <LkFail- Init+ EOC- TXO- <CRCErr=0
		Link Config: MLWI=16bit MLWO=16bit LWI=16bit LWO=16bit
		Revision ID: 1.02

00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-

00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
	Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Capabilities: [f0] #0f [0010]

03:08.0 Communication controller: Performance Technologies, Inc. Unknown device 334a
	Subsystem: Performance Technologies, Inc. Unknown device 334a
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
	Status: Cap- 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
	Latency: 32, Cache Line Size 08
	Interrupt: pin A routed to IRQ 255
	Region 0: Memory at fd7ff000 (32-bit, non-prefetchable) [size=512]
	Region 1: I/O ports at ac00 [size=256]
	Region 2: Memory at fc800000 (32-bit, non-prefetchable) [size=8M]


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROBLEM: fstat(2) returns st_size==0 for non-empty FIFO.
  2008-09-09 23:05 PROBLEM: fstat(2) returns st_size==0 for non-empty FIFO John Wenker
@ 2008-09-10  9:19 ` Alejandro Riveira Fernández
  2008-09-10  9:24 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Alejandro Riveira Fernández @ 2008-09-10  9:19 UTC (permalink / raw)
  To: John Wenker; +Cc: linux-kernel

El Tue, 9 Sep 2008 16:05:06 -0700
John Wenker <jjw@pt.com> escribió:

> A colleague has run into a problem.  We assume it's a kernel issue.  Here 
> is the pertinent bug report data.
> 
> [1.] One line summary of the problem:
> fstat(2) returns st_size == 0 for a FIFO that is known to have data in it.
> 
> [2.] Full description of the problem/report:
> When using a FIFO, fstat(2) (and stat(2)) returns a 'struct stat' with the 
> st_size field equal to zero, at a time when the FIFO is known to have data 
> in it.  Problem occurs with Linux 2.6.16 kernel (see more below), but does 
> not occur on 2.4.20.
> 
> [3.] Keywords (i.e., modules, networking, kernel):
> stat, fstat, FIFO, struct stat, st_size, system call, write
> 
> [4.] Kernel version (from /proc/version):
> Linux version 2.6.16.13-4-default (geeko@buildhost) (gcc version 4.1.0 
> (SUSE Linux)) #1 Wed May 3 04:53:23 UTC 2006
> 
> Note: Problem does _not_ occur on Linux version 2.4.20-8 
> (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 2003022 (Red Hat 
> Linux 3.2.2-5)) #1 Thu Mar 13 17:54:28 EST 2003
> 
> [5.] Output of Oops.. message (if applicable) with symbolic information 
>      resolved (see Documentation/oops-tracing.txt)
> No oops.  Problem doesn't cause system crash, only affects behavior of 
> user applications.
> 
> [6.] A small shell script or example program which triggers the
>      problem (if possible)
> I don't know if this qualifies as "small", but there is a 'C' program 
> attached that will reproduce the problem (fifo.c).

 FWIW
 $ LC_ALL=C ./fifo test
 Enter a string to write into the FIFO: Hello World!        
 fifo: WARNING - 0 (of 14 requested) bytes written into FIFO.
 0 bytes in FIFO.
 $ uname -r                                                                                
 2.6.27-rc5
                                                                                          

 
 

> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PROBLEM: fstat(2) returns st_size==0 for non-empty FIFO.
  2008-09-09 23:05 PROBLEM: fstat(2) returns st_size==0 for non-empty FIFO John Wenker
  2008-09-10  9:19 ` Alejandro Riveira Fernández
@ 2008-09-10  9:24 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2008-09-10  9:24 UTC (permalink / raw)
  To: John Wenker; +Cc: linux-kernel

John Wenker <jjw@pt.com> writes:

> [1.] One line summary of the problem:
> fstat(2) returns st_size == 0 for a FIFO that is known to have data in it.

st_size has no meaning except for regular files and symlinks.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-10  9:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09 23:05 PROBLEM: fstat(2) returns st_size==0 for non-empty FIFO John Wenker
2008-09-10  9:19 ` Alejandro Riveira Fernández
2008-09-10  9:24 ` Andreas Schwab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.