Segmentation fault in a make check

Hi,

I'm trying to work with the orocos-rtt-1.0.3 version. I have compiled it in a
debian etch platform with:

- a patch 2.6.17 rtai kernel, working and passed the test of rtai.
- gcc suite 4.1.2

I have compiled all the orocos core without any problem with:
mkdir build
cd build
../configure
make rtt
make check

however, in this pass I have segmentation fault. Running a one only test, I
have:

ulises:/home/palomo/robotica/orocos/orocos-rtt-1.0.3/build/tests# ./core-test
Segmentation fault
ulises:/home/palomo/robotica/orocos/orocos-rtt-1.0.3/build/tests#
gdb ./core-test
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db
library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) bt
No stack.
(gdb) run
Starting
program: /home/palomo/robotica/orocos/orocos-rtt-1.0.3/build/tests/core-test
[Thread debugging using libthread_db enabled]
[New Thread -1495566656 (LWP 11310)]
warning: Lowest section in /usr/lib/libicudata.so.36 is .hash at 000000b4

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1495566656 (LWP 11310)]
0x08117d83 in _rtai_lxrt ()
(gdb) bt
#0 0x08117d83 in _rtai_lxrt ()
#1 0x08118102 in RTT::OS::detail::rtos_task_create_main ()
#2 0x08118365 in RTT::OS::MainThread::MainThread ()
#3 0x081183c6 in RTT::OS::MainThread::Instance ()
#4 0x08117c3b in __os_init ()
#5 0x080fa7ae in main ()
(gdb) q
The program is running. Exit anyway? (y or n) y

Probably I'm doing something wrong. I don't have any experience programing a
real task. But, could you tell me what I'm doing wrong?

Thank's in advance,

Leo

_______________________________________________
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Segmentation fault in a make check

[...]
> (gdb) bt
> #0 0x08117d83 in _rtai_lxrt ()
> #1 0x08118102 in RTT::OS::detail::rtos_task_create_main ()
> #2 0x08118365 in RTT::OS::MainThread::MainThread ()
> #3 0x081183c6 in RTT::OS::MainThread::Instance ()
> #4 0x08117c3b in __os_init ()
> #5 0x080fa7ae in main ()
> (gdb) q
> The program is running. Exit anyway? (y or n) y
>
>
> Probably I'm doing something wrong. I don't have any experience programing a
> real task. But, could you tell me what I'm doing wrong?

Are the necessary RTAI modules loaded?
If yes, is there anything useful (error messages, that is :-) in the
orocos logfile (orocos.log) or in the kernel messages?

Klaas

_______________________________________________
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Segmentation fault in a make check

A Dilluns 26 Febrer 2007 11:43, Klaas Gadeyne va escriure:
> [...]
>
> > (gdb) bt
> > #0 0x08117d83 in _rtai_lxrt ()
> > #1 0x08118102 in RTT::OS::detail::rtos_task_create_main ()
> > #2 0x08118365 in RTT::OS::MainThread::MainThread ()
> > #3 0x081183c6 in RTT::OS::MainThread::Instance ()
> > #4 0x08117c3b in __os_init ()
> > #5 0x080fa7ae in main ()
> > (gdb) q
> > The program is running. Exit anyway? (y or n) y
> >
> >
> > Probably I'm doing something wrong. I don't have any experience
> > programing a real task. But, could you tell me what I'm doing wrong?
>
> Are the necessary RTAI modules loaded?

nops :-(

> If yes, is there anything useful (error messages, that is :-) in the
> orocos logfile (orocos.log) or in the kernel messages?
Ok,

now all is running. As always, stupid mistakes .....

thanks,

Leo
_______________________________________________
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Segmentation fault in a make check

A Dilluns 26 Febrer 2007 12:23, Leopold Palomo-Avellaneda va escriure:
> A Dilluns 26 Febrer 2007 11:43, Klaas Gadeyne va escriure:
> > [...]
> >
> > > (gdb) bt
> > > #0 0x08117d83 in _rtai_lxrt ()
> > > #1 0x08118102 in RTT::OS::detail::rtos_task_create_main ()
> > > #2 0x08118365 in RTT::OS::MainThread::MainThread ()
> > > #3 0x081183c6 in RTT::OS::MainThread::Instance ()
> > > #4 0x08117c3b in __os_init ()
> > > #5 0x080fa7ae in main ()
> > > (gdb) q
> > > The program is running. Exit anyway? (y or n) y
> > >
> > >
> > > Probably I'm doing something wrong. I don't have any experience
> > > programing a real task. But, could you tell me what I'm doing wrong?
> >
> > Are the necessary RTAI modules loaded?
>
> nops :-(
>
> > If yes, is there anything useful (error messages, that is :-) in the
> > orocos logfile (orocos.log) or in the kernel messages?
>
> Ok,
>
> now all is running. As always, stupid mistakes .....

well,

it's not true what I said. I was very optimistic. I did a make check and:

OK (18)
PASS: core-test

but the box is hanged.

Could you tell me which rtai modules have I to load?

Regards,

Leo
_______________________________________________
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Segmentation fault in a make check

The problem is most likely with the LXRT slots available on your system. It is set by default to 100 by RTAI which is far to low.
See http://www.orocos.org/stable/documentation/rtt/v1.0.x/doc/orocos-installation for setting RTAI to the correct slots. You can check the number of slots with:

$ cat /proc/rtai/names (.. or "/proc/rtai/RTAI names" depending on your RTAI version )

It should be at least 500, but take 1000 to be on the safe side :-)

Other reasons include compiler issues, for example, compiling with -O3. You need to have rtai_hal, rtai_lxrt and rtai_sem loaded.

Peter

Segmentation fault in a make check

A Dimarts 27 Febrer 2007 13:26, sspr va escriure:
> The problem is most likely with the LXRT slots available on your system. It
> is set by default to 100 by RTAI which is far to low. See
> http://www.orocos.org/stable/documentation/rtt/v1.0.x/doc/orocos-installati
>on for setting RTAI to the correct slots. You can check the number of slots
> with:
>
> $ cat /proc/rtai/names (.. or "/proc/rtai/RTAI names" depending on your
> RTAI version )
>
> It should be at least 500, but take 1000 to be on the safe side :-)

it's curious. I have compiled rtai 3.4 and it's not exactly the same
configuration that you comment in the documentation. In this point, the 3.4
has:
CONFIG_RTAI_SCHED_LXRT_NUMSLOTS:
The maximum number of registrable objects in RTAI.

and I have selected 500 as you commented. Howeber, I have this result:

# cat /proc/rtai/names

RTAI LXRT Information.

MAX_SLOTS = 150

Linux_Owner Parent PID
Slot Name ID Type RT_Handle Pointer Tsk_PID MEM_Sz USG
Cnt
-------------------------------------------------------------------------------

and I don't know why....

> Other reasons include compiler issues, for example, compiling with -O3. You
> need to have rtai_hal, rtai_lxrt and rtai_sem loaded.

I have realised another question in this. I can load:
# modprobe -v rtai_hal
insmod /lib/modules/2.6.17-rtai/rtai/rtai_hal.ko
# modprobe -v rtai_lxrt
insmod /lib/modules/2.6.17-rtai/rtai/rtai_lxrt.ko
# modprobe -v rtai_sem
insmod /lib/modules/2.6.17-rtai/rtai/rtai_sched.ko
WARNING: Error inserting rtai_sched
(/lib/modules/2.6.17-rtai/rtai/rtai_sched.ko): Invalid module format
insmod /lib/modules/2.6.17-rtai/rtai/rtai_sem.ko

but with rtai_sem seems that want to load the rtai_sched that collision with
rtai_lxrt. However the module is loaded.

regards,

Leo

Segmentation fault in a make check

[...]
> it's not true what I said. I was very optimistic. I did a make check and:
>
>
> OK (18)
> PASS: core-test
>
> but the box is hanged.
>
> Could you tell me which rtai modules have I to load?

Also don't forget to check the FAQ

Klaas

_______________________________________________
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Segmentation fault in a make check

A Dimarts 27 Febrer 2007 13:16, Klaas Gadeyne va escriure:
> [...]
>
> > it's not true what I said. I was very optimistic. I did a make check and:
> >
> >
> > OK (18)
> > PASS: core-test
> >
> > but the box is hanged.
> >
> > Could you tell me which rtai modules have I to load?
>
> >ion#general_setup_rtai>
>
> Also don't forget to check the FAQ

:-(

sorry,

I think that is better that I go to dinner and take a good coffee .....

Regards,

Leo
_______________________________________________
Orocos-Dev mailing list
Orocos-Dev [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-dev

Segmentation fault in a make check

A Dimarts 27 Febrer 2007 13:27, Leopold Palomo-Avellaneda va escriure:
> A Dimarts 27 Febrer 2007 13:16, Klaas Gadeyne va escriure:
> > [...]
> >
> > > it's not true what I said. I was very optimistic. I did a make check
> > > and:
> > >
> > >
> > > OK (18)
> > > PASS: core-test
> > >
> > > but the box is hanged.
> > >
> > > Could you tell me which rtai modules have I to load?
> >
> > > >at ion#general_setup_rtai>
> >
> > Also don't forget to check the FAQ
> >
> :-(
>
> sorry,
>
> I think that is better that I go to dinner and take a good coffee .....
>
after that, I have done the test but (maybe the lxrt slots ....)

make[3]: Entering directory
`/home/palomo/robotica/orocos/orocos-rtt-1.0.3/build/tests'
...F...............

time_test.cpp:124:Assertion
Test name: TimeTest::testTimeProgress
assertion failed
- Expression: -EPSILON < (change_S - hbg->secondsSince(t)) && EPSILON >
(change
_S - hbg->secondsSince(t))

Failures !!!
Run: 18 Failure total: 1 Failures: 1 Errors: 0
FAIL: core-test
4.105 [CRITICAL][./task-test::main()] The PThread thread seems to be blocked (
ret was 65534 .)
9.206 [CRITICAL][./task-test::main()] The PThread thread seems to be blocked (
ret was 65534 .)
9.615 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
11.030 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
23.331 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
35.631 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
35.672 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
36.977 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
38.389 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
38.430 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
39.730 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
39.774 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
41.076 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
43.118 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
44.406 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
.....

OK (5)
PASS: task-test
....................

OK (20)
PASS: event-test
...................

OK (19)
PASS: taskcontext-test
................

OK (16)
PASS: parser-test
...................

OK (19)
PASS: program-test
......

OK (6)
PASS: state-test
===================
1 of 7 tests failed
===================

Regards,

Leo

Segmentation fault in a make check

Hi Leo,

Quoting Leopold Palomo Avellaneda <lepalom [..] ...>:
>
> make[3]: Entering directory
> `/home/palomo/robotica/orocos/orocos-rtt-1.0.3/build/tests'
> ...F...............
>
> time_test.cpp:124:Assertion
> Test name: TimeTest::testTimeProgress
> assertion failed
> - Expression: -EPSILON < (change_S - hbg->secondsSince(t)) && EPSILON >
> (change
> _S - hbg->secondsSince(t))
>
> Failures !!!
> Run: 18 Failure total: 1 Failures: 1 Errors: 0
> FAIL: core-test

This is caused by a rouding error in the RTAI time conversion. EPSILON
was set too small (1ns) it should be at least 2 or 3 ns. Don't worry
about it.

> 4.105 [CRITICAL][./task-test::main()] The PThread thread seems to be
> blocked (
> ret was 65534 .)
> 9.206 [CRITICAL][./task-test::main()] The PThread thread seems to be
> blocked (
> ret was 65534 .)
> 9.615 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
> be blocked ( ret was 65534 .)
> 11.030 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 23.331 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 35.631 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 35.672 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 36.977 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 38.389 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 38.430 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 39.730 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 39.774 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 41.076 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 43.118 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)
> 44.406 [CRITICAL][./task-test::main()] The TimerThreadInstance thread
> seems to
> be blocked ( ret was 65534 .)

These errors are surely caused by the low SLOTS count. But it seems
Orocos could recover. Your application will do fine with 'only' 150
slots though.

> .....
>
> OK (5)
> PASS: task-test
> ....................
>
> OK (20)
> PASS: event-test
> ...................
>
> OK (19)
> PASS: taskcontext-test
> ................
>
> OK (16)
> PASS: parser-test
> ...................
>
> OK (19)
> PASS: program-test
> ......
>
> OK (6)
> PASS: state-test
> ===================
> 1 of 7 tests failed
> ===================

All by all, your RTT installation seems ready for use !

Peter

Segmentation fault in a make check

A Dimecres 28 Febrer 2007 10:10, Peter Soetens va escriure:
> Hi Leo,
>
> Quoting Leopold Palomo Avellaneda <lepalom [..] ...>:
> > make[3]: Entering directory
> > `/home/palomo/robotica/orocos/orocos-rtt-1.0.3/build/tests'
> > ...F...............
> >
> > time_test.cpp:124:Assertion
> > Test name: TimeTest::testTimeProgress
> > assertion failed
> > - Expression: -EPSILON < (change_S - hbg->secondsSince(t)) && EPSILON >
> > (change
> > _S - hbg->secondsSince(t))
> >
> > Failures !!!
> > Run: 18 Failure total: 1 Failures: 1 Errors: 0
> > FAIL: core-test
>
> This is caused by a rouding error in the RTAI time conversion. EPSILON
> was set too small (1ns) it should be at least 2 or 3 ns. Don't worry
> about it.

Ok, I have seen the mail about bug 263 and I have changed the file. Now the
test have passed :-) but with problems.
OK (18)
PASS: core-test
4.105 [CRITICAL][./task-test::main()] The PThread thread seems to be blocked (
ret was 65534 .)
9.206 [CRITICAL][./task-test::main()] The PThread thread seems to be blocked (
ret was 65534 .)
9.615 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
11.030 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
23.331 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
35.631 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
35.672 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
36.977 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
38.389 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
38.430 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
39.731 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
39.774 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
41.076 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
43.118 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
44.406 [CRITICAL][./task-test::main()] The TimerThreadInstance thread seems to
be blocked ( ret was 65534 .)
.....

>
> These errors are surely caused by the low SLOTS count. But it seems
> Orocos could recover. Your application will do fine with 'only' 150
> slots though.

yes, but do you have made some test with rtai-3.4? I have this:
CONFIG_RTAI_SCHED_LXRT_NUMSLOTS="500"

in the .rtai-config....

>
> All by all, your RTT installation seems ready for use !

good!!!!!

Thank's,

Leo