* Data corruption when using TCP sockets
@ 2005-12-02 11:35 madanagopal
2005-12-02 14:26 ` Benjamin LaHaise
0 siblings, 1 reply; 4+ messages in thread
From: madanagopal @ 2005-12-02 11:35 UTC (permalink / raw)
To: linux-net; +Cc: netdev
hai,
We have a socket application in C which connects to a Java application
through TCP sockets. We use read() system call to read from the socket.
The Java application sends more than 20000 bytes of data sometimes. In the
C program, we read those bytes as Type,Length,Value fields where a
separate read() call is used for each field. This sometimes creates a data
corruption while it works other times.
We observe that the first 16384 bytes get read properly. Extra byte or
bytes get added in the 16385 th location and this shifts the bytes from
16385 onwards. Because of this our C program gets confused and we are
forced to reopen the socket. This is not predictable. Suddenly this
problem occurs. Is this an already known issue and if so what
is it? How to solve it?
We are running both the applications in the same machine which runs
Red Hat Linux release 7.2 and its kernel version is 2.4.7-10
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Data corruption when using TCP sockets
2005-12-02 11:35 Data corruption when using TCP sockets madanagopal
@ 2005-12-02 14:26 ` Benjamin LaHaise
2005-12-02 15:01 ` madanagopal
0 siblings, 1 reply; 4+ messages in thread
From: Benjamin LaHaise @ 2005-12-02 14:26 UTC (permalink / raw)
To: madanagopal; +Cc: linux-net, netdev
That kernel is beyond ancient -- a 2.4.9 errata kernel was released on
the day that Red Hat 7.2 shipped. It is known buggy and superceeded by
many kernels with substantial bugfixes.
-ben
On Fri, Dec 02, 2005 at 05:05:28PM +0530, madanagopal wrote:
> hai,
> We have a socket application in C which connects to a Java application
> through TCP sockets. We use read() system call to read from the socket.
> The Java application sends more than 20000 bytes of data sometimes. In the
> C program, we read those bytes as Type,Length,Value fields where a
> separate read() call is used for each field. This sometimes creates a data
> corruption while it works other times.
> We observe that the first 16384 bytes get read properly. Extra byte or
> bytes get added in the 16385 th location and this shifts the bytes from
> 16385 onwards. Because of this our C program gets confused and we are
> forced to reopen the socket. This is not predictable. Suddenly this
> problem occurs. Is this an already known issue and if so what
> is it? How to solve it?
> We are running both the applications in the same machine which runs
> Red Hat Linux release 7.2 and its kernel version is 2.4.7-10
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
"You know, I've seen some crystals do some pretty trippy shit, man."
Don't Email: <dont@kvack.org>.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Data corruption when using TCP sockets
2005-12-02 14:26 ` Benjamin LaHaise
@ 2005-12-02 15:01 ` madanagopal
2005-12-02 15:07 ` Benjamin LaHaise
0 siblings, 1 reply; 4+ messages in thread
From: madanagopal @ 2005-12-02 15:01 UTC (permalink / raw)
To: Benjamin LaHaise; +Cc: linux-net, netdev
hai,
Sorry to ask again. Was this exact problem noticed and fixed in some
kernel version? If so which version is it? If it is not possible to get
that info, which version should we use and are we guaranteed that this
problem will not be present in it?
> That kernel is beyond ancient -- a 2.4.9 errata kernel was released on
> the day that Red Hat 7.2 shipped. It is known buggy and superceeded by
> many kernels with substantial bugfixes.
>
> -ben
>
> On Fri, Dec 02, 2005 at 05:05:28PM +0530, madanagopal wrote:
> > hai,
> > We have a socket application in C which connects to a Java application
> > through TCP sockets. We use read() system call to read from the socket.
> > The Java application sends more than 20000 bytes of data sometimes. In the
> > C program, we read those bytes as Type,Length,Value fields where a
> > separate read() call is used for each field. This sometimes creates a data
> > corruption while it works other times.
> > We observe that the first 16384 bytes get read properly. Extra byte or
> > bytes get added in the 16385 th location and this shifts the bytes from
> > 16385 onwards. Because of this our C program gets confused and we are
> > forced to reopen the socket. This is not predictable. Suddenly this
> > problem occurs. Is this an already known issue and if so what
> > is it? How to solve it?
> > We are running both the applications in the same machine which runs
> > Red Hat Linux release 7.2 and its kernel version is 2.4.7-10
> > -
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Data corruption when using TCP sockets
2005-12-02 15:01 ` madanagopal
@ 2005-12-02 15:07 ` Benjamin LaHaise
0 siblings, 0 replies; 4+ messages in thread
From: Benjamin LaHaise @ 2005-12-02 15:07 UTC (permalink / raw)
To: madanagopal; +Cc: linux-net, netdev
On Fri, Dec 02, 2005 at 08:31:01PM +0530, madanagopal wrote:
> hai,
> Sorry to ask again. Was this exact problem noticed and fixed in some
> kernel version? If so which version is it? If it is not possible to get
> that info, which version should we use and are we guaranteed that this
> problem will not be present in it?
It certainly isn't a known problem with any recent 2.4 or 2.6 kernels.
-ben
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-12-02 15:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-02 11:35 Data corruption when using TCP sockets madanagopal
2005-12-02 14:26 ` Benjamin LaHaise
2005-12-02 15:01 ` madanagopal
2005-12-02 15:07 ` Benjamin LaHaise
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).