corrupted real-time input stream

Bret Stern bret_stern at machinemanagement.com
Tue Mar 13 17:00:30 UTC 2007


 

> -----Original Message-----
> From: redhat-install-list-bounces at redhat.com 
> [mailto:redhat-install-list-bounces at redhat.com] On Behalf Of 
> Carl Reynolds
> Sent: Tuesday, March 13, 2007 10:27 AM
> To: redhat-install-list at redhat.com
> Subject: corrupted real-time input stream
> 
> I have a program (that acts like a server) that reads data 
> from a port in real time. It then writes the data to a file 
> used as a buffer. 
> Another program connects to the program via an ethernet 
> socket and requests that the data be transmitted. At that 
> point the server program reads the data back out of the 
> buffer file and shoves it out the socket. 
> Note: the buffer file is stored in its own partition which is xfs.
> 
> I was away for a couple of weeks and during that time we had 
> a power outage, a log file on the machine filled up the root 
> partition, and another programmer upgraded the kernel from 
> 2.6.18-1.2849 to 2.6.19-1.2911. When I got back the server 
> program was not working. I have traced the problem to the 
> "bytes = read(fd, data, len)" statement in the server program.
> 
> When the server reads the data from the buffer file, it is 
> asking for 128K bytes. It gets 128K, but the end of the input 
> from about 85K is filled with 0s. If I save the buffer file 
> to another location and 'od' 
> the file, I can see that the data being written to the buffer 
> file is correct and does not contain the area of 0s returned 
> by the read. I tried changing the length requested by the 
> read so that it was only asking for 32K bytes at a time, but 
> the data still contains 0s from about 80K on.
> 
> I assume that when the other programmer upgraded the kernel, 
> he inadvertently changed a parameter that controls how the OS 
> handles read requests, but I can't figure out what it is.
> 
> Does anyone have a clue what might be causing this problem? 
> If I knew what was causing the problem, I might be able to 
> fix it. As it is, I'm in the dark.
> 
> Thanks for any help you may be able to give me on this.
> 
> 
> 
> Carl.
> 
> 
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe

Some straws..

It sounds like the buffer may be initialized with '0', with
the exception of the note you make regarding the different file
location.

Perhaps the buffer already exists (hidden)?? When running your
program, do you check if the buffer already exists?

Debugging is about as much fun as one person can have!





More information about the Redhat-install-list mailing list