Help: Creation of RTEMS Message Queue hangs up computer

Joel Sherrill <joel@OARcorp.com> joel.sherrill at OARcorp.com
Tue Dec 21 21:51:19 UTC 2004



Alex wrote:
> Hi,
> I am trying to use posix message queues in RTEMS. I have a little program that only creates a message queue, nothing else. But when the mq_open() posix function is executed all the system blocks forever. I already “debug” the kernel and what I saw was the _RTEMS_Lock_allocator() function, in regiongetsegment.c file, which blocks forever but I can't see why...

This sounds like a known bug.  What version of RTEMS are you running?

--joel


> ENV: pc686, mandrake linux 9.2, rtems 4.6, i686 bsp
> 
> Could you help me please?
> Any advices?
> 
> By the way, why do we need regions in rtems? Which is the main aim of regions? In rtems the memeory is completly flat isn't it? So, why regions?
> 
> Many thanks,
> 
> Alex
> (RTEMS Beginner)
> 
> 
> This is my little rtems posix program:
> 
> #define CONFIGURE_INIT
> #include <rtems.h>
> #include <bsp.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <pthread.h> 
> #include <limits.h>
> #include <unistd.h>  
> #include <errno.h>
> #include <sched.h> 
> #include <sched.h>
> #include <fcntl.h>
> #include <time.h>  
> #include <signal.h>
> #include <mqueue.h>
> #include <rtems/posix/mqueue.h>
> #include <rtems/posix/time.h>
> #define CONFIGURE_INIT_TASK_ENTRY_POINT   POSIX_Init
> 
> void *POSIX_Init(void *argument)
> {
> mqd_t               mq;
> 
> puts( "\n\n-- POSIX MESSAGE QUEUE --" );
> //CREATING / OPENING MESSAGE QUEUE
> mq = mq_open("Q_Write", O_CREAT | O_RDWR, 0x777,NULL);
> if(mq==-1)
> {
>          printf("\nError opening message queue Q_Write...");
>          exit(0);
> }
> else
> {
>          printf("\nQueue Q_Write successfully opened...");
> }
> 
>    puts( "-- END OF POSIX MESSAGE QUEUE PROGRAM --");
>    exit(0);
> }
> 
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> #define CONFIGURE_POSIX_INIT_THREAD_TABLE
> #define CONFIGURE_MAXIMUM_POSIX_THREADS               2
> #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES  10
> #define CONFIGURE_MAXIMUM_POSIX_TIMERS                   4
> #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              20
> #define CONFIGURE_MAXIMUM_REGIONS                    4
> #define CONFIGURE_POSIX_INIT_THREAD_TABLE
> #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE  (RTEMS_MINIMUM_STACK_SIZE * 4)
> #define CONFIGURE_EXTRA_TASK_STACKS  (5 * RTEMS_MINIMUM_STACK_SIZE)
> #include <confdefs.h>
>  
> 
> 
> ________________________________________________________________________________
> Finalmente uma Caixa de Correio com todos os Extras: 21 MB + Anti-vírus + Filtro de
> mensagens indesejadas + Attachs 7MB + Bloqueador IOL + Conteúdos IOL + Ícones dinâmicos…
> Crie aqui a sua: http://www.iol.pt/correio/rodape.php?dst=0411151
> 


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985




More information about the users mailing list