All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Need help with pipes
@ 2008-03-06  9:36 Laurent BESSARD
  2008-03-06  9:50 ` Philippe Gerum
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent BESSARD @ 2008-03-06  9:36 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 1196 bytes --]

Hello everybody,

I'm using Xenomai for realtime developments for a couple of time. I have 
written a program using pipes for Xenomai 2.1.0 and a 2.6.15 Linux 
kernel compiled with Xenomai support. All worked or seemed to work fine.

Recently, I decided to upgrade my system to Xenomai 2.4.1 and a 2.6.23 
Linux kernel. But during my program execution, I get a kernel 
segmentation fault while I try to delete the pipe. After having test any 
possibility of problem while deleting pipe, I finally find that just 
creating and then deleting a pipe causes a kernel segmentation fault.

Now I don't know where my problem is located:
   - There is something I'm doing wrong when I use pipes.
   - I have mis-installed Xenomai on my system.
   - It is a known problem with the version of Xenomai I installed.

I attached a sample of code that causes my problem.

Could anybody help me?
Thank you in advance.

Best regards,

Laurent BESSARD

-- 
LOLITech - TBI sarl
24, rue Pierre Evrat
88100 Saint-Dié des Vosges
tel: 03 29 52 95 67
fax: 03 29 58 93 16
laurent.bessard@domain.hid <mailto:laurent.bessard@domain.hid>
http://www.lolitech.fr 	<http://www.lolitech.fr>


[-- Attachment #2: test_pipe.c --]
[-- Type: text/x-csrc, Size: 942 bytes --]

#include <stdio.h>
#include <signal.h>
#include <sys/fcntl.h>
#include <unistd.h>
#include <sys/mman.h>

#include <native/task.h>
#include <native/timer.h>
#include <native/pipe.h>

#define PIPE_DEVICE        "/dev/rtp0"
#define PIPE_MINOR         0
#define PIPE_SIZE          500000

RT_PIPE test_pipe;

int main(int argc, char* argv[])
{
    int ret = 0;

    /* no memory-swapping for this programm */
    mlockall(MCL_CURRENT | MCL_FUTURE);

    /* create test_pipe */
    ret = rt_pipe_create(&test_pipe, "test_pipe", PIPE_MINOR, PIPE_SIZE);
    if (ret) {
        printf("failed to create test_pipe, code %d\n",ret);
        goto error;
    }
    printf("test_pipe created\n");

    /* delete test_pipe */
    ret = rt_pipe_delete(&test_pipe);
    if (ret) {
        printf("failed to delete test_pipe, code %d\n",ret);
        goto error;
    }
    printf("test_pipe deleted\n");

    pause();
    return 0;

error:
    return ret;
}


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

end of thread, other threads:[~2008-03-08 17:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06  9:36 [Xenomai-help] Need help with pipes Laurent BESSARD
2008-03-06  9:50 ` Philippe Gerum
2008-03-06 16:06   ` Laurent BESSARD
2008-03-06 16:54     ` Gilles Chanteperdrix
2008-03-08 17:46     ` 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.