* [Xenomai] TCP communication problem
@ 2012-05-31 8:08 Frederik Bayart
2012-05-31 9:54 ` dietmar.schindler
0 siblings, 1 reply; 6+ messages in thread
From: Frederik Bayart @ 2012-05-31 8:08 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 2445 bytes --]
Hallo,
When switching from xenomai 2.4.10 on linux 2.6.30.8 (x86) to xenomai
2.6.0 (stable) on linux 2.6.38.8, we noticed some TCP communication
problem between client and server in our application. We wrote a test
program and think this reproduces the problem.
First a short description of the test program :
When the client (rtest.c attached) connects to the server (rtestd.c
attached), the server starts sending packets to the client. Packets
are paired : first a header and then a corresponding data packet. The
payload of each packet starts with a sequence number (to match network
traces and logging), followed with hdr[A..Z])2222222...222hdr[A..Z]
for header and dat[A..Z]77777777...777dat[A..Z] for data packets.
The client can also sent request to server (using the same
connection). The server echoes these packets back.
Client requests are also paired : first a header and then a
corresponding data packet. The payload of each packet starts with a
sequence number (to match network traces and logging), followed with
fre[A..Z])3333333...333fre[A..Z] for header and
rik[A..Z]88888888...888rik[A..Z] for data packets.
Header and data packets have to arrive one after the oter. For that
reason, sending is protected by a mutex.
The send command used in the server is the normal send, so tasks are
switching from primary to secondary domain, but I think sending should
be protected by the mutex.
Also the task that echoes client requests has higher priority.
Client requests can be initiated to the client sending the TRAP signal, e.g
for i in {0..9000} ; do kill -TRAP <pid>; done
where <pid> is the process id of the client process.
If you execute this some times after each other, we noticed that we
have lost some data.
In attached rtest.log, rule 6 , the tail of the packet
(...22222222hdrE) is lost.
This can also be seen in the network trace : packet 4 contains the
first part of the header, but packet 6 contains the start of the data
packet
Client and server are run on different hosts. The ip adress of the
server is given as argument to the client, so e.g. ./rtest
192.168.0.40
At the moment it's not clear to us whether the problem is caused by
the new xenomai, or by the new kernel, so my question is :
Can the problem be caused by different behaviour of the new xenomai :
new scheduler, no mutex protection in the secondary domain, ... ?
Frederik
[-- Attachment #2: rtest.zip --]
[-- Type: application/zip, Size: 4786 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] TCP communication problem
2012-05-31 8:08 [Xenomai] TCP communication problem Frederik Bayart
@ 2012-05-31 9:54 ` dietmar.schindler
2012-06-04 9:33 ` Frederik Bayart
0 siblings, 1 reply; 6+ messages in thread
From: dietmar.schindler @ 2012-05-31 9:54 UTC (permalink / raw)
To: xenomai
Hallo,
Frederik wrote:
> When the client (rtest.c attached) connects to the server (rtestd.c
> attached), the server starts sending packets to the client. Packets
> are paired : first a header and then a corresponding data packet. The
> payload of each packet starts with a sequence number (to match network
> traces and logging), followed with hdr[A..Z])2222222...222hdr[A..Z]
> for header and dat[A..Z]77777777...777dat[A..Z] for data packets.
> ...
> If you execute this some times after each other, we noticed that we
> have lost some data.
>
> In attached rtest.log, rule 6 , the tail of the packet
> (...22222222hdrE) is lost.
Perhaps the hdr send() call has been interrupted by a signal; this would have gone unnoticed because the server does not compare the return value of the send() call (i. e. the number of characters sent) to the hdr message length.
If this is so, the question remains, which signal did occur?
--
Dietmar
________________________________________
manroland web systems GmbH -- Managing Director: Uwe Lüders
Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No. 26816 -- VAT: DE281389840
Confidentiality note:
This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, please notify us immediately via info@manroland-web.com, then delete this eMail.
- Please consider your environmental responsibility before printing this eMail
________________________________________
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] TCP communication problem
2012-05-31 9:54 ` dietmar.schindler
@ 2012-06-04 9:33 ` Frederik Bayart
2012-06-04 9:53 ` Philippe Gerum
0 siblings, 1 reply; 6+ messages in thread
From: Frederik Bayart @ 2012-06-04 9:33 UTC (permalink / raw)
To: xenomai
Dietmar, thanks for hint. Indeed, I noticed that the number of bytes
sent != bytes to send.
If I wrap the send in a while lus, the problem is solved.
Does anyone have a suggestion how to detect the interrupting signal
(SIG_ALL doesn't exist)
Frederik
On 31 May 2012 11:54, <dietmar.schindler@manroland.com> wrote:
> Hallo,
>
> Frederik wrote:
>> When the client (rtest.c attached) connects to the server (rtestd.c
>> attached), the server starts sending packets to the client. Packets
>> are paired : first a header and then a corresponding data packet. The
>> payload of each packet starts with a sequence number (to match network
>> traces and logging), followed with hdr[A..Z])2222222...222hdr[A..Z]
>> for header and dat[A..Z]77777777...777dat[A..Z] for data packets.
>> ...
>> If you execute this some times after each other, we noticed that we
>> have lost some data.
>>
>> In attached rtest.log, rule 6 , the tail of the packet
>> (...22222222hdrE) is lost.
>
> Perhaps the hdr send() call has been interrupted by a signal; this would have gone unnoticed because the server does not compare the return value of the send() call (i. e. the number of characters sent) to the hdr message length.
> If this is so, the question remains, which signal did occur?
> --
> Dietmar
> ________________________________________
> manroland web systems GmbH -- Managing Director: Uwe Lüders
> Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No. 26816 -- VAT: DE281389840
>
> Confidentiality note:
> This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, please notify us immediately via info@manroland-web.com, then delete this eMail.
>
> - Please consider your environmental responsibility before printing this eMail
> ________________________________________
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> http://www.xenomai.org/mailman/listinfo/xenomai
--
Frederik Bayart | Senior software engineer
Triphase NV | Research Park Zone 1719 | Romeinse straat 18 | B-3001 Heverlee
T +32 2 669 06 05 | E frederik.bayart@triphase.com | W www.triphase.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] TCP communication problem
2012-06-04 9:33 ` Frederik Bayart
@ 2012-06-04 9:53 ` Philippe Gerum
2012-06-04 10:03 ` Gilles Chanteperdrix
0 siblings, 1 reply; 6+ messages in thread
From: Philippe Gerum @ 2012-06-04 9:53 UTC (permalink / raw)
To: Frederik Bayart; +Cc: xenomai
On 06/04/2012 11:33 AM, Frederik Bayart wrote:
> Dietmar, thanks for hint. Indeed, I noticed that the number of bytes
> sent != bytes to send.
> If I wrap the send in a while lus, the problem is solved.
>
> Does anyone have a suggestion how to detect the interrupting signal
> (SIG_ALL doesn't exist)
>
Use strace.
It's likely SIGWINCH (aka SIGSHADOW for Xenomai), which we use internally.
> Frederik
>
> On 31 May 2012 11:54,<dietmar.schindler@manroland.com> wrote:
>> Hallo,
>>
>> Frederik wrote:
>>> When the client (rtest.c attached) connects to the server (rtestd.c
>>> attached), the server starts sending packets to the client. Packets
>>> are paired : first a header and then a corresponding data packet. The
>>> payload of each packet starts with a sequence number (to match network
>>> traces and logging), followed with hdr[A..Z])2222222...222hdr[A..Z]
>>> for header and dat[A..Z]77777777...777dat[A..Z] for data packets.
>>> ...
>>> If you execute this some times after each other, we noticed that we
>>> have lost some data.
>>>
>>> In attached rtest.log, rule 6 , the tail of the packet
>>> (...22222222hdrE) is lost.
>>
>> Perhaps the hdr send() call has been interrupted by a signal; this would have gone unnoticed because the server does not compare the return value of the send() call (i. e. the number of characters sent) to the hdr message length.
>> If this is so, the question remains, which signal did occur?
>> --
>> Dietmar
>> ________________________________________
>> manroland web systems GmbH -- Managing Director: Uwe Lüders
>> Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No. 26816 -- VAT: DE281389840
>>
>> Confidentiality note:
>> This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, please notify us immediately via info@manroland-web.com, then delete this eMail.
>>
>> - Please consider your environmental responsibility before printing this eMail
>> ________________________________________
>> _______________________________________________
>> Xenomai mailing list
>> Xenomai@xenomai.org
>> http://www.xenomai.org/mailman/listinfo/xenomai
>
>
>
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] TCP communication problem
2012-06-04 9:53 ` Philippe Gerum
@ 2012-06-04 10:03 ` Gilles Chanteperdrix
2012-06-04 10:05 ` Philippe Gerum
0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2012-06-04 10:03 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
On 06/04/2012 11:53 AM, Philippe Gerum wrote:
> On 06/04/2012 11:33 AM, Frederik Bayart wrote:
>> Dietmar, thanks for hint. Indeed, I noticed that the number of bytes
>> sent != bytes to send.
>> If I wrap the send in a while lus, the problem is solved.
>>
>> Does anyone have a suggestion how to detect the interrupting signal
>> (SIG_ALL doesn't exist)
>>
>
> Use strace.
>
> It's likely SIGWINCH (aka SIGSHADOW for Xenomai), which we use internally.
SIGWINCH handler is normally installed with SA_RESTART flag...
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai] TCP communication problem
2012-06-04 10:03 ` Gilles Chanteperdrix
@ 2012-06-04 10:05 ` Philippe Gerum
0 siblings, 0 replies; 6+ messages in thread
From: Philippe Gerum @ 2012-06-04 10:05 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
On 06/04/2012 12:03 PM, Gilles Chanteperdrix wrote:
> On 06/04/2012 11:53 AM, Philippe Gerum wrote:
>> On 06/04/2012 11:33 AM, Frederik Bayart wrote:
>>> Dietmar, thanks for hint. Indeed, I noticed that the number of bytes
>>> sent != bytes to send.
>>> If I wrap the send in a while lus, the problem is solved.
>>>
>>> Does anyone have a suggestion how to detect the interrupting signal
>>> (SIG_ALL doesn't exist)
>>>
>>
>> Use strace.
>>
>> It's likely SIGWINCH (aka SIGSHADOW for Xenomai), which we use internally.
>
> SIGWINCH handler is normally installed with SA_RESTART flag...
>
Normally, yes.
--
Philippe.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-06-04 10:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 8:08 [Xenomai] TCP communication problem Frederik Bayart
2012-05-31 9:54 ` dietmar.schindler
2012-06-04 9:33 ` Frederik Bayart
2012-06-04 9:53 ` Philippe Gerum
2012-06-04 10:03 ` Gilles Chanteperdrix
2012-06-04 10:05 ` Philippe Gerum
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.