From: Stefan Kisdaroczi <kisda@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] native skin 2.5.0: rt_task_create() segfaults if stacksize parameter too small
Date: Thu, 07 Jan 2010 15:55:17 +0100 [thread overview]
Message-ID: <4B45F5D5.1080001@domain.hid> (raw)
In-Reply-To: <4B45F163.4000504@domain.hid>
[-- Attachment #1.1: Type: text/plain, Size: 775 bytes --]
Am 07.01.2010 15:36, schrieb Gilles Chanteperdrix:
> Stefan Kisdaroczi wrote:
>> hi,
>>
>> i have upgraded xenomai to 2.5.0 (x86,32bit). My application segfaults when I
>> try to create a task with stacksize 2048, this worked with 2.4.10.
>> Because my app is written in pascal i have reproduced the problem with the
>> xenomai trivial-periodic.c example:
>>
>> - rt_task_create(&demo_task, "trivial", 0, 99, 0);
>> + rt_task_create(&demo_task, "trivial",16911, 99, 0);
>>
>> Stacksize 0 -> default stack size : ok
>> Stacksize > 0 and <= 16911 : Segmentation fault
>> Stacksize >= 16912 : ok
>>
>> Any hints ?
>
> What does the task do?
Nothing :-)
I have attached a patch for the trivial-periodic.c example to reproduce the problem.
thx
kisda
[-- Attachment #1.2: trivial-stacksize.diff --]
[-- Type: text/plain, Size: 1126 bytes --]
--- trivial-periodic.old 2009-03-31 10:51:10.000000000 +0200
+++ trivial-periodic.c 2010-01-07 16:24:28.000000000 +0100
@@ -12,30 +12,6 @@ RT_TASK demo_task;
void demo(void *arg)
{
- RTIME now, previous;
-
- /*
- * Arguments: &task (NULL=self),
- * start time,
- * period (here: 1 s)
- */
- rt_task_set_periodic(NULL, TM_NOW, 1000000000);
- previous = rt_timer_read();
-
- while (1) {
- rt_task_wait_period(NULL);
- now = rt_timer_read();
-
- /*
- * NOTE: printf may have unexpected impact on the timing of
- * your program. It is used here in the critical loop
- * only for demonstration purposes.
- */
- printf("Time since last turn: %ld.%06ld ms\n",
- (long)(now - previous) / 1000000,
- (long)(now - previous) % 1000000);
- previous = now;
- }
}
void catch_signal(int sig)
@@ -57,7 +33,7 @@ int main(int argc, char* argv[])
* priority,
* mode (FPU, start suspended, ...)
*/
- rt_task_create(&demo_task, "trivial", 0, 99, 0);
+ rt_task_create(&demo_task, "trivial",16911, 99, 0);
/*
* Arguments: &task,
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]
next prev parent reply other threads:[~2010-01-07 14:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-07 14:32 [Xenomai-help] native skin 2.5.0: rt_task_create() segfaults if stacksize parameter too small Stefan Kisdaroczi
2010-01-07 14:36 ` Gilles Chanteperdrix
2010-01-07 14:55 ` Stefan Kisdaroczi [this message]
2010-01-07 15:48 ` Stefan Kisdaroczi
2010-01-07 16:57 ` Gilles Chanteperdrix
2010-01-07 17:26 ` Stefan Kisdaroczi
2010-01-08 11:47 ` Stefan Kisdaroczi
2010-01-08 11:57 ` Gilles Chanteperdrix
2010-01-08 13:24 ` Stefan Kisdaroczi
2010-01-08 13:30 ` Gilles Chanteperdrix
2010-01-08 13:41 ` Stefan Kisdaroczi
2010-01-08 13:52 ` Gilles Chanteperdrix
2010-01-08 14:07 ` Stefan Kisdaroczi
2010-01-08 13:54 ` Gilles Chanteperdrix
2010-01-08 13:59 ` Stefan Kisdaroczi
2010-01-08 15:57 ` Stefan Kisdaroczi
2010-01-08 17:12 ` Gilles Chanteperdrix
2010-01-08 22:37 ` Gilles Chanteperdrix
2010-01-11 10:53 ` Stefan Kisdaroczi
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=4B45F5D5.1080001@domain.hid \
--to=kisda@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--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.