* [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
@ 2007-05-30 8:11 Rodolfo Bamberg
0 siblings, 0 replies; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 8:11 UTC (permalink / raw)
To: xenomai
I forgot: I used 2.6.20.4 kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
@ 2007-05-30 7:46 Rodolfo Bamberg
2007-05-30 8:05 ` Jan Kiszka
0 siblings, 1 reply; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 7:46 UTC (permalink / raw)
To: xenomai
Hi
I get a segmentation fault when I run my user-space RT app (native skin).
I did the following steps:
- Cross-Compiled the Kernel with Xenomai support for an i386 target.
- I Cross - Compiled Xenomai with uClibc: run ./configure using the
--host=i386-linux-uclibc option, and using the new configure.in I read
about in the uClibC discussion.
- I wrote a test program that includes <native/task.h> and
<native/timer.h>.
- I then got this segmentation faults and I reduced my program to not
using xenomai and only printing something. I igured out that the
"-lnative" lib directive in the makefile was causing the problem.
Do you know what might be the problem??
Thanks!
Rodolfo Bamberg
Here's my makefile:
obj-m := hallo.o rt_process.o
RTAI_INCLUDE_DIR
:=/home/rodolfo/kernel/linux-2.6.20-xenomai/include/xenomai
XENOMAI_INCLUDE_DIR_USP
:=/home/rodolfo/xenomai/xenomai-2.3.1/src/include
XENOMAI_INCLUDE_DIR_USP2:=/home/rodolfo/xenomai/xenomai-2.3.1/include
XENOMAI_INCLUDE_LIB_USP :=/tftpboot/192.168.0.2/usr/xenomai/lib
default:
i386-linux-uclibc-gcc -I$(XENOMAI_INCLUDE_DIR_USP)
-I$(XENOMAI_INCLUDE_DIR_USP2) -lnative -L$(XENOMAI_INCLUDE_LIB_USP) -o
rt_process_user rt_process_user.c
chmod a+x rt_process_user
clean:
rm -f *.mod.c *.o *.ko rt_process
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 7:46 Rodolfo Bamberg
@ 2007-05-30 8:05 ` Jan Kiszka
2007-05-30 8:39 ` Rodolfo Bamberg
0 siblings, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2007-05-30 8:05 UTC (permalink / raw)
To: Rodolfo Bamberg; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1787 bytes --]
Rodolfo Bamberg wrote:
> Hi
> I get a segmentation fault when I run my user-space RT app (native skin).
> I did the following steps:
> - Cross-Compiled the Kernel with Xenomai support for an i386 target.
> - I Cross - Compiled Xenomai with uClibc: run ./configure using the
> --host=i386-linux-uclibc option, and using the new configure.in I read
> about in the uClibC discussion.
> - I wrote a test program that includes <native/task.h> and
> <native/timer.h>.
> - I then got this segmentation faults and I reduced my program to not
> using xenomai and only printing something. I igured out that the
> "-lnative" lib directive in the makefile was causing the problem.
Looks like the init code of libnative that is executed automatically on
program start is involved here.
> Do you know what might be the problem??
Could you attach gdb to your program and check where it segfaults
precisely? Also, does the same crash happens with "latency", the Xenomai
benchmark tool based on Native services?
> Thanks!
>
> Rodolfo Bamberg
>
> Here's my makefile:
>
> obj-m := hallo.o rt_process.o
> RTAI_INCLUDE_DIR
That looks like legacy. ;)
> :=/home/rodolfo/kernel/linux-2.6.20-xenomai/include/xenomai
> XENOMAI_INCLUDE_DIR_USP
> :=/home/rodolfo/xenomai/xenomai-2.3.1/src/include
> XENOMAI_INCLUDE_DIR_USP2:=/home/rodolfo/xenomai/xenomai-2.3.1/include
> XENOMAI_INCLUDE_LIB_USP :=/tftpboot/192.168.0.2/usr/xenomai/lib
>
>
> default:
>
> i386-linux-uclibc-gcc -I$(XENOMAI_INCLUDE_DIR_USP)
> -I$(XENOMAI_INCLUDE_DIR_USP2) -lnative -L$(XENOMAI_INCLUDE_LIB_USP) -o
> rt_process_user rt_process_user.c
> chmod a+x rt_process_user
>
> clean:
> rm -f *.mod.c *.o *.ko rt_process
>
>
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 249 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 8:05 ` Jan Kiszka
@ 2007-05-30 8:39 ` Rodolfo Bamberg
2007-05-30 8:52 ` Jan Kiszka
0 siblings, 1 reply; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 8:39 UTC (permalink / raw)
To: xenomai
I tried to use latency and got this. Am I missing something within the
Kernel? I didn't find an option for TSC. I use the 2.6.20.4 kernel
/usr/bin $ latency
Xenomai: incompatible feature set
(required="sep tsc", present="sep", missing="tsc").
Jan Kiszka wrote:
> Rodolfo Bamberg wrote:
>
>> Hi
>> I get a segmentation fault when I run my user-space RT app (native skin).
>> I did the following steps:
>> - Cross-Compiled the Kernel with Xenomai support for an i386 target.
>> - I Cross - Compiled Xenomai with uClibc: run ./configure using the
>> --host=i386-linux-uclibc option, and using the new configure.in I read
>> about in the uClibC discussion.
>> - I wrote a test program that includes <native/task.h> and
>> <native/timer.h>.
>> - I then got this segmentation faults and I reduced my program to not
>> using xenomai and only printing something. I igured out that the
>> "-lnative" lib directive in the makefile was causing the problem.
>>
>
> Looks like the init code of libnative that is executed automatically on
> program start is involved here.
>
>
>> Do you know what might be the problem??
>>
>
> Could you attach gdb to your program and check where it segfaults
> precisely? Also, does the same crash happens with "latency", the Xenomai
> benchmark tool based on Native services?
>
>
>> Thanks!
>>
>> Rodolfo Bamberg
>>
>> Here's my makefile:
>>
>> obj-m := hallo.o rt_process.o
>> RTAI_INCLUDE_DIR
>>
>
> That looks like legacy. ;)
>
>
>> :=/home/rodolfo/kernel/linux-2.6.20-xenomai/include/xenomai
>> XENOMAI_INCLUDE_DIR_USP
>> :=/home/rodolfo/xenomai/xenomai-2.3.1/src/include
>> XENOMAI_INCLUDE_DIR_USP2:=/home/rodolfo/xenomai/xenomai-2.3.1/include
>> XENOMAI_INCLUDE_LIB_USP :=/tftpboot/192.168.0.2/usr/xenomai/lib
>>
>>
>> default:
>>
>> i386-linux-uclibc-gcc -I$(XENOMAI_INCLUDE_DIR_USP)
>> -I$(XENOMAI_INCLUDE_DIR_USP2) -lnative -L$(XENOMAI_INCLUDE_LIB_USP) -o
>> rt_process_user rt_process_user.c
>> chmod a+x rt_process_user
>>
>> clean:
>> rm -f *.mod.c *.o *.ko rt_process
>>
>>
>>
>
> Jan
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 8:39 ` Rodolfo Bamberg
@ 2007-05-30 8:52 ` Jan Kiszka
2007-05-30 9:19 ` Rodolfo Bamberg
2007-05-30 9:26 ` Rodolfo Bamberg
0 siblings, 2 replies; 11+ messages in thread
From: Jan Kiszka @ 2007-05-30 8:52 UTC (permalink / raw)
To: Rodolfo Bamberg; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 492 bytes --]
Rodolfo Bamberg wrote:
> I tried to use latency and got this. Am I missing something within the
> Kernel? I didn't find an option for TSC. I use the 2.6.20.4 kernel
>
> /usr/bin $ latency
> Xenomai: incompatible feature set
> (required="sep tsc", present="sep", missing="tsc").
>
Make sure your kernel config contains CONFIG_M586TSC or better - or
build the user space part with --disable-x86-tsc (but only if your
hardware is really predating any Pentium class CPU).
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 8:52 ` Jan Kiszka
@ 2007-05-30 9:19 ` Rodolfo Bamberg
2007-05-30 9:26 ` Rodolfo Bamberg
1 sibling, 0 replies; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 9:19 UTC (permalink / raw)
To: xenomai
I recompiled the kernel with TSC and latency works. The native app still
throws a segmentation fault. I should debug it
Jan Kiszka wrote:
> Rodolfo Bamberg wrote:
>
>> I tried to use latency and got this. Am I missing something within the
>> Kernel? I didn't find an option for TSC. I use the 2.6.20.4 kernel
>>
>> /usr/bin $ latency
>> Xenomai: incompatible feature set
>> (required="sep tsc", present="sep", missing="tsc").
>>
>>
>
> Make sure your kernel config contains CONFIG_M586TSC or better - or
> build the user space part with --disable-x86-tsc (but only if your
> hardware is really predating any Pentium class CPU).
>
> Jan
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 8:52 ` Jan Kiszka
2007-05-30 9:19 ` Rodolfo Bamberg
@ 2007-05-30 9:26 ` Rodolfo Bamberg
2007-05-30 11:56 ` Jan Kiszka
2007-05-30 12:00 ` Dmitry Adamushko
1 sibling, 2 replies; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 9:26 UTC (permalink / raw)
To: xenomai
I just can't figure out: If latency works, and it uses the native skin,
why does including libnative throw a segmantation fault?
Jan Kiszka wrote:
> Rodolfo Bamberg wrote:
>
>> I tried to use latency and got this. Am I missing something within the
>> Kernel? I didn't find an option for TSC. I use the 2.6.20.4 kernel
>>
>> /usr/bin $ latency
>> Xenomai: incompatible feature set
>> (required="sep tsc", present="sep", missing="tsc").
>>
>>
>
> Make sure your kernel config contains CONFIG_M586TSC or better - or
> build the user space part with --disable-x86-tsc (but only if your
> hardware is really predating any Pentium class CPU).
>
> Jan
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 9:26 ` Rodolfo Bamberg
@ 2007-05-30 11:56 ` Jan Kiszka
2007-05-30 12:29 ` Rodolfo Bamberg
2007-05-30 12:00 ` Dmitry Adamushko
1 sibling, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2007-05-30 11:56 UTC (permalink / raw)
To: Rodolfo Bamberg; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 263 bytes --]
Rodolfo Bamberg wrote:
> I just can't figure out: If latency works, and it uses the native skin,
> why does including libnative throw a segmantation fault?
Have you tried to attach gdb?
What toolchain do you use precisely? How to regenerate it?
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 11:56 ` Jan Kiszka
@ 2007-05-30 12:29 ` Rodolfo Bamberg
0 siblings, 0 replies; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 12:29 UTC (permalink / raw)
To: xenomai
I use buildroot, but cross-compiled apps with shared libs work fine,
like busybox
Jan Kiszka wrote:
> Rodolfo Bamberg wrote:
>
>> I just can't figure out: If latency works, and it uses the native skin,
>> why does including libnative throw a segmantation fault?
>>
>
> Have you tried to attach gdb?
>
> What toolchain do you use precisely? How to regenerate it?
>
> Jan
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 9:26 ` Rodolfo Bamberg
2007-05-30 11:56 ` Jan Kiszka
@ 2007-05-30 12:00 ` Dmitry Adamushko
2007-05-30 12:25 ` Rodolfo Bamberg
1 sibling, 1 reply; 11+ messages in thread
From: Dmitry Adamushko @ 2007-05-30 12:00 UTC (permalink / raw)
To: Rodolfo Bamberg; +Cc: Xenomai help
On 30/05/07, Rodolfo Bamberg <rolfetas@domain.hid> wrote:
> I just can't figure out: If latency works, and it uses the native skin,
> why does including libnative throw a segmantation fault?
>
Do you have Xenomai support built in-kernel or in external modules?
How do you run your application and latency (i.e. do you actually
launch the "latency"'s executable)?
Probably, it shouldn't be a case (I don't remember all the
installation/runtime details by heart any more) but be sure the
xenomai modules are loaded by the moment your application starts.
Although, I'd expect some more user-friendly behavior from the
libnative in such a case.. so maybe it's not a case.
Get a core dump when it crushes and feed it to "gdb".. maybe you'll
have some relevant bits from the stacktrace.
--
Best regards,
Dmitry Adamushko
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Xenomai-help] [Newbie question]Segmentation fault with user-space binary
2007-05-30 12:00 ` Dmitry Adamushko
@ 2007-05-30 12:25 ` Rodolfo Bamberg
0 siblings, 0 replies; 11+ messages in thread
From: Rodolfo Bamberg @ 2007-05-30 12:25 UTC (permalink / raw)
To: xenomai
Dmitry Adamushko wrote:
> On 30/05/07, Rodolfo Bamberg <rolfetas@domain.hid> wrote:
>> I just can't figure out: If latency works, and it uses the native skin,
>> why does including libnative throw a segmantation fault?
>>
>
> Do you have Xenomai support built in-kernel or in external modules?
> How do you run your application and latency (i.e. do you actually
> launch the "latency"'s executable)?
>
> Probably, it shouldn't be a case (I don't remember all the
> installation/runtime details by heart any more) but be sure the
> xenomai modules are loaded by the moment your application starts.
>
> Although, I'd expect some more user-friendly behavior from the
> libnative in such a case.. so maybe it's not a case.
>
> Get a core dump when it crushes and feed it to "gdb".. maybe you'll
> have some relevant bits from the stacktrace.
>
>
Xenomai support is built-in within the Kernel. Latency works for both
Kernel and User-Space modes, as an executable. Is there any other way to
use latency? as a kernel loadable module? I will try to bind-statically
everything with Xenomai support to the Kernel and see if it makes a
change. If not I'll try to cross-debug my app.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-05-30 12:29 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-30 8:11 [Xenomai-help] [Newbie question]Segmentation fault with user-space binary Rodolfo Bamberg
-- strict thread matches above, loose matches on Subject: below --
2007-05-30 7:46 Rodolfo Bamberg
2007-05-30 8:05 ` Jan Kiszka
2007-05-30 8:39 ` Rodolfo Bamberg
2007-05-30 8:52 ` Jan Kiszka
2007-05-30 9:19 ` Rodolfo Bamberg
2007-05-30 9:26 ` Rodolfo Bamberg
2007-05-30 11:56 ` Jan Kiszka
2007-05-30 12:29 ` Rodolfo Bamberg
2007-05-30 12:00 ` Dmitry Adamushko
2007-05-30 12:25 ` Rodolfo Bamberg
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.