From: Larice Robert <larice@vidisys.de>
To: Stephen Morgan <smorgan@almaden.ibm.com>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] bug allert, variable alignment problem in ecos
Date: Fri, 14 Jun 2002 04:02:00 -0000 [thread overview]
Message-ID: <200206141103.g5EB3wT08630@doms.vidisys.com> (raw)
In-Reply-To: <OF42C1A141.18A2B675-ON88256BD6.005C9F57@boulder.ibm.com> from Stephen Morgan at "Jun 12, 2002 09:58:32 am"
Hello Stephen,
how did you deal with this, did you stop the project, did you find
a solution, or did you just live with the linker lottery.
most of the time you wont notice the problem, because most global objects
are aligned to 4 byte. so if there are just few in-between, you have
a good chance to be lucky.
actually the problem i've described is not C++ specific. though
the want to allocate space for some class object, and the want
to avoid constructor calling, has led to some
char space[sizeof(class ..)];
in the ecos tree, which is another manifestation of the alignment problem.
to extend your aside, for me too, the decision to use C++ for the
bit-tiddling internals of an embedded realtime os is a bit
unexpected. but with great care can be done, and has merits too.
anyway, i've sent a patch for almost 200 dangerous global variables
to ecos-patches. (though most of them are in some test directories, and
thus of minor significance. those will even be helpfull to get
accustomed with the debugger)
Robert Larice
> Yes. We saw the problem in debugging eCos on a MIPS32 processor and it
> drove us crazy. It showed up especially in threads structures as these
> are shared between C and C++ code, which apparently have different
> alignment rules.
>
> As an aside, I'm a dyed in the wool C programmer, and find C++ a miserable
> language. Why would anyone mix C and C++ within an operating system? Of
> course, I use vi as I find emacs incomprehensible, which may indicate
> something about my sensibilities -- or merely my abilities... 8-)
>
> Stephen P. Morgan
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
next prev parent reply other threads:[~2002-06-14 11:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-12 9:58 Stephen Morgan
2002-06-14 4:02 ` Larice Robert [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-06-14 16:15 Stephen Morgan
2002-06-12 7:01 Larice Robert
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=200206141103.g5EB3wT08630@doms.vidisys.com \
--to=larice@vidisys.de \
--cc=ecos-discuss@sources.redhat.com \
--cc=smorgan@almaden.ibm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).