From: Laurent BESSARD <laurent.bessard@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] Need help with pipes
Date: Thu, 06 Mar 2008 10:36:46 +0100 [thread overview]
Message-ID: <47CFBB2E.3010700@domain.hid> (raw)
[-- 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;
}
next reply other threads:[~2008-03-06 9:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 9:36 Laurent BESSARD [this message]
2008-03-06 9:50 ` [Xenomai-help] Need help with pipes Philippe Gerum
2008-03-06 16:06 ` Laurent BESSARD
2008-03-06 16:54 ` Gilles Chanteperdrix
2008-03-08 17:46 ` Philippe Gerum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47CFBB2E.3010700@domain.hid \
--to=laurent.bessard@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.