Hello
We have a configuration based on QEMU, Xenomai 2.5.4 and we use the PSOS
skin.
[ 0.623238] Xenomai: hal/i386 started.
[ 0.633758] Xenomai: scheduling class idle registered.
[ 0.636172] Xenomai: scheduling class rt registered.
[ 0.693178] Xenomai: real-time nucleus v2.5.4 (Sleep Walk) loaded.
[ 0.723234] Xenomai: starting native API services.
[ 0.728107] Xenomai: starting pSOS+ services.
I'm currently writing a test application in pSOS to check whether the
run-time behavior is equal to the real PSOS implementation.
The check function I use is based in the one found in
"/src/testsuite/unit/rtdm.c" of the xenomai distribution.
This is a piece of the test code I use:
static void test_queue(void)
{
unsigned long qid;
unsigned long mesg[4] = {0,1,2,3};
unsigned long recv_msg[4];
char testCaseName[32];
printf("test_queue\n");
check("q_create",q_create("TEST",0,Q_NOLIMIT|Q_PRIOR,&qid),0);
check("q_send",q_send(qid,mesg),0);
check("q_receive",q_receive(qid,Q_NOWAIT,0,recv_msg),0);
check("q_receive TO",q_receive(qid,Q_WAIT,50,recv_msg),ERR_TIMEOUT);
for (i=0;i<10000;i++)
{
sprintf(testCaseName,"q_send LOOP %d",i);
mesg[3] = (unsigned long)i;
check(testCaseName,q_send(qid,mesg),0);
}
while (q_receive(qid,Q_NOWAIT,0,recv_msg) == 0);
check("q_delete",q_delete(qid),0);
}
This function is called in a loop:
i = 0;
while (1)
{
test_queue();
printf("LoopCount = %d\n",i++);
}
If I run the testcode I get:
test_queue
FAILED test_queue:216: q_send LOOP 7808 returned 52 instead of 0 - Unknown
error -52
If I change the number of messages I send to the queue to for example 100, I
observe more or less the same behavior.
After a number of invocations of the "test_queue" functions, the same error
is reported.
test_queue
LoopCount = 117
test_queue
LoopCount = 118
test_queue
LoopCount = 119
test_queue
LoopCount = 120
test_queue
FAILED test_queue:216: q_send LOOP 64 returned 52 instead of 0 - Unknown
error -52
Once the test is failed and I restart the application, I get immediately a
failure:
test_queue
FAILED test_queue:216: q_send LOOP 64 returned 52 instead of 0 - Unknown
error -52
So it looks to me that there is a memory leak in the message handling
mechanism inside the kernel module.
It looks like op to 64 messages can be sent to the queue but I get a failure
as soon as I want to send more.
As a last test I changed the number of loop iterations to 64.
After doing this the test keeps on running forever.
Another question I have: is there any testcode available for the pSOS skin?
If not I'm willing the share my code once it is finalized.
Thanks
Ronny
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help