All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Howto catch SEGV signals in Xenomai
@ 2007-03-13 14:51 M. Koehrer
  2007-03-13 15:19 ` Philippe Gerum
  2007-03-13 15:25 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 16+ messages in thread
From: M. Koehrer @ 2007-03-13 14:51 UTC (permalink / raw)
  To: xenomai


[-- Attachment #1.1: Type: text/plain, Size: 1836 bytes --]

Hi all,

I have a problem to catch segment violations with Xenomai:
For demonstration I use the following program:
------------------------------------------
#include <stdio.h>
#include <sys/mman.h>

#include <native/task.h>
#include <native/sem.h>
RT_TASK taska_desc;
volatile int *pointer = 0;

void mytaska(void *cookie)
{
    int i;
    for (i=0; i < 50; i++)
    {
        rt_task_sleep(50000000);
        if (i > 20)
        {
            *pointer = 123;
        }
        printf("Hello %i\n", i);
    }
    printf("Hi, this is task A\n");
}

int main(void)
{
    mlockall(MCL_CURRENT|MCL_FUTURE);

    rt_task_create(&taska_desc, "mytaska", 0, 81, T_JOINABLE);
    rt_task_start(&taska_desc, &mytaska, NULL);

    rt_task_join(&taska_desc);
    printf("Main: A joined\n");

    return 0;
}
---------------------------------------
Whenever i is greater than 20 a segment violation occurs, as I must not write
to address 0 (the pointer is always NULL).
However, what happens is, that my system freezes after printing out 18 or 19.
I have to reset the PC to continue.
When I write a printf() directly before the invalid assignment I get the usual linux
"segmentation fault" error message.

How can I catch a signal in a Xenomai real time task?

I am running Xenomai 2.3.0 + NOCOW patch.

I have enclosed the .c file and a Makefile in a .tgz file.

Thanks for any feedback on that issue

Regards

Mathias
~
~



-- 
Mathias Koehrer
mathias_koehrer@domain.hid


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur  39,85 €  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2

[-- Attachment #2: signal.tgz --]
[-- Type: application/octet-stream, Size: 697 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread
* Re: Re: [Xenomai-help] Howto catch SEGV signals in Xenomai
@ 2007-03-14 12:36 M. Koehrer
  2007-03-14 13:26 ` Philippe Gerum
  0 siblings, 1 reply; 16+ messages in thread
From: M. Koehrer @ 2007-03-14 12:36 UTC (permalink / raw)
  To: rpm, mathias_koehrer; +Cc: xenomai

Hi Philippe, 

I applied again the patch to the 2.6.19.2 (adeos-ipipe-2.6.19-i386-1.6-03.patch)
and also enabled the nucleus debug option.
But there is no change. The system still freezes.

Regards

Mathias
> > I used this patch on the UP kernel 2.6.19.2. Same adeos version as
> before.
> > The result  was the same => PC freeze
> > 
> 
> Make sure to switch on the nucleus debug option, so that this code
> triggers if appropriate.
> 
> -- 
> Philippe.
> 
> 
> 


-- 
Mathias Koehrer
mathias_koehrer@domain.hid


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: günstig
und schnell mit DSL - das All-Inclusive-Paket für clevere Doppel-Sparer,
nur  39,85 €  inkl. DSL- und ISDN-Grundgebühr!
http://www.arcor.de/rd/emf-dsl-2


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

end of thread, other threads:[~2007-03-14 13:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-13 14:51 [Xenomai-help] Howto catch SEGV signals in Xenomai M. Koehrer
2007-03-13 15:19 ` Philippe Gerum
2007-03-13 15:36   ` M. Koehrer
2007-03-13 15:25 ` Gilles Chanteperdrix
2007-03-13 15:52   ` Philippe Gerum
2007-03-13 19:21     ` Gilles Chanteperdrix
2007-03-13 22:34       ` Philippe Gerum
2007-03-13 22:37         ` Philippe Gerum
2007-03-14  8:17           ` M. Koehrer
2007-03-14  8:47             ` M. Koehrer
2007-03-14 10:35               ` Philippe Gerum
2007-03-14 11:18                 ` M. Koehrer
2007-03-14 13:32                   ` Philippe Gerum
2007-03-14 11:02             ` Philippe Gerum
  -- strict thread matches above, loose matches on Subject: below --
2007-03-14 12:36 M. Koehrer
2007-03-14 13:26 ` Philippe Gerum
2007-03-14 13:26   ` Gilles Chanteperdrix
2007-03-14 13:33     ` 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.