From: Sven Eckelmann <sven.eckelmann@gmx.de>
To: Nathan Wharton <naw@greptar.com>
Cc: b.a.t.m.a.n@open-mesh.net
Subject: Re: [B.A.T.M.A.N.] Debug Malloc Problem
Date: Wed, 27 May 2009 18:16:01 +0200 [thread overview]
Message-ID: <200905271816.04764.sven.eckelmann@gmx.de> (raw)
In-Reply-To: <4313f3060905270720k45859cb5y822c47397482b77c@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]
On Wednesday 27 May 2009 16:20:16 Nathan Wharton wrote:
> On Tue, May 26, 2009 at 5:13 PM, Sven Eckelmann <sven.eckelmann@gmx.de>
wrote:
> > =========================================
> > #include <stdio.h>
> > #include <stdlib.h>
> >
> > #define x_moved(pos) ((int*)&x[pos])[0]
> > static const int value1 = 0x01234567;
> > static const int value2 = 0x89abcdef;
> >
> > int main() {
> > volatile char *x = (char*)malloc(sizeof(int) * 2);
> > x_moved(0) = value1;
> > x_moved(2) = value2;
> >
> > if (x_moved(2) != value2) {
> > printf("ERROR Value: ");
> > } else {
> > printf("Value: ");
> > }
> > printf("%x %x\n", x_moved(0) , x_moved(2));
> >
> > free(x);
> > return 0;
> > }
> > =========================================
>
> This results in:
> ERROR Value: 89abcdef cdef89ab
Thanks. This is completely unexpecting for a kernel with alignment trap. The
expected result is "Value: 12389ab 89abcdef". Can you check the value of
/proc/cpu/alignment ? I will look further at it this evening.
Regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 835 bytes --]
next prev parent reply other threads:[~2009-05-27 16:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-26 18:48 [B.A.T.M.A.N.] Debug Malloc Problem Nathan Wharton
2009-05-26 18:50 ` Nathan Wharton
2009-05-26 22:13 ` Sven Eckelmann
2009-05-27 0:06 ` Nathan Wharton
2009-05-27 9:28 ` Marek Lindner
2009-05-27 14:20 ` Nathan Wharton
2009-05-27 16:07 ` Nathan Wharton
2009-05-27 16:16 ` Sven Eckelmann [this message]
2009-05-27 16:21 ` Nathan Wharton
2009-05-27 16:35 ` Nathan Wharton
2009-05-27 17:13 ` Sven Eckelmann
2009-05-27 17:21 ` Nathan Wharton
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=200905271816.04764.sven.eckelmann@gmx.de \
--to=sven.eckelmann@gmx.de \
--cc=b.a.t.m.a.n@open-mesh.net \
--cc=naw@greptar.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