corrupted real-time input stream
Carl Reynolds
redhat-install-list at hyperbole-software.com
Tue Mar 13 17:27:05 UTC 2007
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.
More information about the Redhat-install-list
mailing list