All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] rt_queue_write strange behaviour ++
@ 2007-11-30 10:42 Roderik.Wildenburg
  2007-11-30 10:55 ` Philippe Gerum
  0 siblings, 1 reply; 7+ messages in thread
From: Roderik.Wildenburg @ 2007-11-30 10:42 UTC (permalink / raw)
  To: xenomai

Sorry, but in my last mail (see below) I had forgotten to tell you my 
Xenomai-Version and architecture.
I still use Xenomai 2.3.2 on PPC.

In the meantime I had a deeper look into the Xenomai source code 
and I would say, the case we observed (msg->refcount == 0 ; see below)
isn´t possible with rt_queue_write, as this function implicitly allocate 
its messagebuffer and rt_queue_alloc initilaizes refcount to 1.
Immediatelly after this rt_queue_send is called, where the 
plausibility test if( msg->refcount == 0) is done and fails. 
So, I can´t see a gap where refcount falls back to 0.

Does any guru have a good idea, I am quite clueless.

Original mail :
--------------------------------------------------------------------

Sometimes we get an EINVAL-Error with rt_queue_write.
If we immediatelly after the EINVAL-Error try an a second time to write
to the queue (with exactly the same parameters as at the first time) the
rt_queue_write succeeds (see appended code sniped) !!??

I traced down (xnprintf) the error to the function rt_queue_send where a
plausibility test is made :

if (xnheap_check_block(&q->bufpool, msg) || msg->refcount == 0) 
[approx at line 614]

this test fail as (msg->refcount == 0).
If I understand the comment correctly :

/* In case of invalid block or if the sender does not own the
   message, just bail out. */

the sender does not own the message.
But if so, the second try should fail also (and I am quite sure the
message belongs to the sender) ?
Does anyone (probabliy Philipe) has an idea in what situation this
problem could occur or what is the reason for this strange behaviour ?

Unfortunately I could not reproduce this problem in a simple testcase, 
but with our application the error occurs regularly (~10 times a hour).
So I rely on your intuition to spike this problem.

Many thanks in advance and best regards
Roderik 

MAN Roland Druckmaschinen AG
Vorsitzender des Aufsichtsrates: Hanno C. Fiedler
Vorstand: Gerd Finkbeiner (Vorsitzender), Dr. Ingo Koch, Dr. Markus Rall, Paul Steidle    
Sitz der Gesellschaft: Offenbach am Main, Registergericht: Amtsgericht Offenbach HRB-Nr. 42592    
USt-Ident-Nr. DE 250200933


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-12-04 12:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-30 10:42 [Xenomai-help] rt_queue_write strange behaviour ++ Roderik.Wildenburg
2007-11-30 10:55 ` Philippe Gerum
2007-11-30 12:22   ` Roderik.Wildenburg
2007-12-03 13:31   ` Roderik.Wildenburg
2007-12-03 15:16     ` [Xenomai-help] rt_queue_write strange behaviour ++ testcase !! Roderik.Wildenburg
2007-12-03 16:50       ` Philippe Gerum
2007-12-04 12:05         ` Roderik.Wildenburg

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.