From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: xenoka09@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] NULL pointer access on bfin when linking with xenomai and pthread
Date: Tue, 25 Jan 2011 10:28:53 +0100 [thread overview]
Message-ID: <4D3E97D5.3050609@domain.hid> (raw)
In-Reply-To: <alpine.DEB.1.10.1101251010320.12329@domain.hid>
Kolja Waschk wrote:
> Ok, I'll start a new thread with the details. I'm not so sure if this is actually
> related to Xenomai, but until now I was only able to reproduce it in conjunction with
> xenomai libs, so ...
>
> The example is already reduced to a minimum. I'm working with a Blackfin-based
> board like BF537-STAMP, with 2010R1-RC5 blackfin-linux-dist on it and stock kernel
> as it comes with the dist (2.6.34.7-ADI-2010R1). Just Xenomai 2.5.3 was replaced
> by 2.5.5.2. Toolchain is 2010R1-RC4 taken as binary from blackfin.uclinux.org.
>
> The code itself actually doesn't seem to matter. The problem can be reproduced with an
> example as simple as this "a.c":
>
>> int main (void) { return 0; }
>
> Normally, this can be started on the target via gdbserver and debugged from the host.
> I used the gdb command script
>
>> file a.out
>> target remote 10.0.10.9:2222
>> break main
>> cont
>
> The target would run the example, and stop, e.g. at "Breakpoint 1, 0x00b7b626 in main ()"
>
> These compile commands produce a working a.out:
>
>> bfin-linux-uclibc-gcc -L/opt/uClinux/blackfin-linux-dist/staging/usr/lib -lpthread a.c
>
> or
>
>> bfin-linux-uclibc-gcc -L/opt/uClinux/blackfin-linux-dist/staging/usr/lib -lpthread_rt -lxenomai a.c
>
> but this one that combines all -l options above doesn't:
>
>> bfin-linux-uclibc-gcc -L/opt/uClinux/blackfin-linux-dist/staging/usr/lib -lpthread_rt -lxenomai -lpthread a.c
>
> (Adding -lrt, to complete the suggested posix-ldflags, doesn't help, so I omit
> it here for shortness)
>
> The result on the target, when started with gdbserver and as soon as the host
> says "cont", is a NULL pointer access. It seems to occur even before main() is
> reached.
Some Xenomai code is executed before the main function is called. What I
do not understand is why gdb does not stop at the place of the segfault?
--
Gilles.
next prev parent reply other threads:[~2011-01-25 9:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-25 9:31 [Xenomai-help] NULL pointer access on bfin when linking with xenomai and pthread Kolja Waschk
2011-01-25 9:28 ` Gilles Chanteperdrix [this message]
2011-01-25 9:46 ` Kolja Waschk
2011-01-25 9:48 ` Kolja Waschk
2011-01-25 9:50 ` Kolja Waschk
2011-01-25 9:52 ` Gilles Chanteperdrix
2011-01-25 10:15 ` Kolja Waschk
2011-01-25 11:22 ` Kolja Waschk
2011-01-25 11:21 ` Gilles Chanteperdrix
2011-01-25 12:37 ` Kolja Waschk
2011-01-25 11:32 ` Kolja Waschk
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=4D3E97D5.3050609@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--cc=xenoka09@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.