All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Possible Xenomai fuse filesystem/registry queue status files issue?
@ 2018-04-01 17:28 Steve Freyder
  2018-04-02 13:41 ` Philippe Gerum
  0 siblings, 1 reply; 15+ messages in thread
From: Steve Freyder @ 2018-04-01 17:28 UTC (permalink / raw)
  To: xenomai

Greetings again.

As I understand it, for each rt_queue there's supposed to be a
"status file" located in the fuse filesystem underneath the
"/run/xenomai/user/session/pid/alchemy/queues" directory, with
the file name being the queue name.  This used to contain very
useful info about queue status, message counts, etc.  I don't know
when it broke or whether it's something I'm doing wrong but I'm
now getting a "memory exhausted" message on the console when I
attempt to do a "cat" on the status file.

Here's a small C program that just creates a queue, and then does
a pause to hold the accessor count non-zero.

----------qc.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
#include <errno.h>
#include <alchemy/queue.h>
#include <alchemy/task.h>

int main(
     int argc,
     char *argv[]
){
     RT_QUEUE q ;
     char *name = argv[1] ;
     int err ;

{
     static RT_TASK MyShadow ;

     mlockall(MCL_CURRENT|MCL_FUTURE);
     err = rt_task_shadow(&MyShadow,NULL,1,0) ;
     if (err < 0)  {
         fprintf(stderr,"shadow: %s\n",strerror(-err)) ;
         exit(-err) ;
     }
}
     err = rt_queue_create(&q,name,1024*1024,1024,Q_FIFO) ;
     if (err < 0)  {
         fprintf(stderr,"rtqc %s: %s\n",name,strerror(-err)) ;
         return(1) ;
     }
     for (int nerrno = 2 ; pause() < 0 && errno == EINTR && --nerrno > 0 
;) ;
     return(0) ;
}
----------qc.c end

A shell script to conduct the test:

----------qtest.sh
#!/bin/sh

set -x
./qc --mem-pool-size=64M --session=mysession foo &
sleep 1
find /run/xenomai
qfile=/run/xenomai/*/*/*/alchemy/queues/foo
cat $qfile
----------qtest.sh

The resulting output (logged in via the system console):

# sh qtest.sh
+ sleep 1
+ ./qc --mem-pool-size=64M --session=mysession foo
+ find /run/xenomai
/run/xenomai
/run/xenomai/root
/run/xenomai/root/mysession
/run/xenomai/root/mysession/821
/run/xenomai/root/mysession/821/alchemy
/run/xenomai/root/mysession/821/alchemy/tasks
/run/xenomai/root/mysession/821/alchemy/tasks/task@1[821]
/run/xenomai/root/mysession/821/alchemy/queues
/run/xenomai/root/mysession/821/alchemy/queues/foo
/run/xenomai/root/mysession/system
/run/xenomai/root/mysession/system/threads
/run/xenomai/root/mysession/system/heaps
/run/xenomai/root/mysession/system/version
+ qfile='/run/xenomai/*/*/*/alchemy/queues/foo'
+ cat /run/xenomai/root/mysession/821/alchemy/queues/foo
memory exhausted

At this point, it hangs, although SIGINT usually terminates it.

I've seen some cases where SIGINT won't terminate it, and a reboot is
required to clean things up.  I see this message appears to be logged
in the obstack error handler.  I don't think I'm running out of memory,
which makes me think "heap corruption".  Not much of an analysis!  I did
try varying queue sizes and max message counts - no change.

Thanks in advance,
Best regards,
Steve



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

end of thread, other threads:[~2018-04-13 16:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-01 17:28 [Xenomai] Possible Xenomai fuse filesystem/registry queue status files issue? Steve Freyder
2018-04-02 13:41 ` Philippe Gerum
2018-04-02 14:54   ` Steve Freyder
2018-04-02 15:20     ` Philippe Gerum
2018-04-02 16:11       ` Steve Freyder
2018-04-02 16:51         ` Philippe Gerum
2018-04-08 23:01           ` Steve Freyder
2018-04-11 14:37             ` Philippe Gerum
2018-04-12  9:31             ` Philippe Gerum
2018-04-12 10:23               ` Philippe Gerum
2018-04-12 15:44                 ` Steve Freyder
2018-04-12 16:05                   ` Philippe Gerum
2018-04-12 17:56                     ` Steve Freyder
2018-04-13  6:36                       ` Philippe Gerum
2018-04-13 16:25                         ` Steve Freyder

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.