From: Stephen Rothwell on
Hi ,

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

*** glibc detected *** scripts/mod/modpost: munmap_chunk(): invalid pointer: 0x00000000004095fc ***
======= Backtrace: =========
/lib/libc.so.6(+0x71b16)[0x2b4f000b6b16]
scripts/mod/modpost[0x40284e]
scripts/mod/modpost[0x403aee]
scripts/mod/modpost[0x40446e]
/lib/libc.so.6(__libc_start_main+0xfd)[0x2b4f00063c4d]
scripts/mod/modpost[0x401219]
======= Memory map: ========
00400000-0040e000 r-xp 00000000 08:11 30327842 /scratch/sfr/powerpc_allyesconfig/scripts/mod/modpost
0060d000-0060e000 rw-p 0000d000 08:11 30327842 /scratch/sfr/powerpc_allyesconfig/scripts/mod/modpost
0060e000-00611000 rw-p 00000000 00:00 0
006cf000-006f0000 rw-p 00000000 00:00 0 [heap]
2b4effe25000-2b4effe43000 r-xp 00000000 08:01 483871 /lib/ld-2.11.2.so
2b4effe43000-2b4effe45000 rw-p 00000000 00:00 0
2b4effe45000-2b4efff9e000 rw-p 00000000 08:11 30334167 /scratch/sfr/powerpc_allyesconfig/arch/powerpc/kernel/built-in.o
2b4f00042000-2b4f00043000 r--p 0001d000 08:01 483871 /lib/ld-2.11.2.so
2b4f00043000-2b4f00044000 rw-p 0001e000 08:01 483871 /lib/ld-2.11.2.so
2b4f00044000-2b4f00045000 rw-p 00000000 00:00 0
2b4f00045000-2b4f0019d000 r-xp 00000000 08:01 483859 /lib/libc-2.11.2.so
2b4f0019d000-2b4f0039c000 ---p 00158000 08:01 483859 /lib/libc-2.11.2.so
2b4f0039c000-2b4f003a0000 r--p 00157000 08:01 483859 /lib/libc-2.11.2.so
2b4f003a0000-2b4f003a1000 rw-p 0015b000 08:01 483859 /lib/libc-2.11.2.so
2b4f003a1000-2b4f003a8000 rw-p 00000000 00:00 0
2b4f003a8000-2b4f003be000 r-xp 00000000 08:01 482546 /lib/libgcc_s.so.1
2b4f003be000-2b4f005bd000 ---p 00016000 08:01 482546 /lib/libgcc_s.so.1
2b4f005bd000-2b4f005be000 rw-p 00015000 08:01 482546 /lib/libgcc_s.so.1
7fffe11d6000-7fffe11f8000 rw-p 00000000 00:00 0 [stack]
7fffe11ff000-7fffe1200000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
/bin/sh: line 1: 5229 Aborted scripts/mod/modpost arch/powerpc/kernel/built-in.o

I got this error a few times during that build and during the sparc64
defconfig build as well.

This was an x86_64 hosted build using libc 2.11.2 from Debian (so eglibc
based), gcc 4.4.4 and binutils 2.20.1-system.20100303.

The only patch new to linux-next since yesterday that affects scripts/mod
is commit 37ed19d5cce35a40d3913cf9aa208ce9f60db3d7
("scripts/mod/modpost.c: fix memory leak") from Linus' tree.

I have reverted that commit in linux-next for today as that makes the
error go away.
--
Cheers,
Stephen Rothwell sfr(a)canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
From: Andrew Morton on
On Wed, 11 Aug 2010 13:38:12 +1000 Stephen Rothwell <sfr(a)canb.auug.org.au> wrote:

> The only patch new to linux-next since yesterday that affects scripts/mod
> is commit 37ed19d5cce35a40d3913cf9aa208ce9f60db3d7
> ("scripts/mod/modpost.c: fix memory leak") from Linus' tree.
>
> I have reverted that commit in linux-next for today as that makes the
> error go away.

doh. This?


From: Andrew Morton <akpm(a)linux-foundation.org>

- don't kfree("")

- fix one missed conversion

Reported-by: Stephen Rothwell <sfr(a)canb.auug.org.au>
Cc: Alexey Fomenko <ext-alexey.fomenko(a)nokia.com>
Cc: Trevor Keith <tsrk(a)tsrk.net>
Cc: Rusty Russell <rusty(a)rustcorp.com.au>
Cc: Michal Marek <mmarek(a)suse.cz>
Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>
---

scripts/mod/modpost.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff -puN scripts/mod/modpost.c~d scripts/mod/modpost.c
--- a/scripts/mod/modpost.c~d
+++ a/scripts/mod/modpost.c
@@ -14,6 +14,7 @@
#define _GNU_SOURCE
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
#include "modpost.h"
#include "../../include/generated/autoconf.h"
#include "../../include/linux/license.h"
@@ -1167,7 +1168,7 @@ static char *sec2annotation(const char *
strcat(p, " ");
return r; /* we leak her but we do not care */
} else {
- return "";
+ return strdup("");
}
}

@@ -1302,7 +1303,7 @@ static void report_sec_mismatch(const ch
"%s%s so it may be used outside an exit section.\n",
from, prl_from, fromsym, from_p,
to, prl_to, tosym, to_p,
- sec2annotation(tosec), tosym, to_p);
+ prl_to, tosym, to_p);
free(prl_from);
free(prl_to);
break;
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Stephen Rothwell on
Hi Andrew,

On Tue, 10 Aug 2010 22:23:10 -0700 Andrew Morton <akpm(a)linux-foundation.org> wrote:
>
> doh. This?
>
>
> From: Andrew Morton <akpm(a)linux-foundation.org>
>
> - don't kfree("")
>
> - fix one missed conversion
>
> Reported-by: Stephen Rothwell <sfr(a)canb.auug.org.au>
> Cc: Alexey Fomenko <ext-alexey.fomenko(a)nokia.com>
> Cc: Trevor Keith <tsrk(a)tsrk.net>
> Cc: Rusty Russell <rusty(a)rustcorp.com.au>
> Cc: Michal Marek <mmarek(a)suse.cz>
> Signed-off-by: Andrew Morton <akpm(a)linux-foundation.org>

works for me, thanks.

Tested-by: Stephen Rothwell <sfr(a)canb.auug.org.au>

Now, don't you wish that had been in linux-next? ;-)

Please send to Linus (if you haven't already) and I will add it to my
fixes tree for linux-next tomorrow unless Linus has taken it by then.

--
Cheers,
Stephen Rothwell sfr(a)canb.auug.org.au
http://www.canb.auug.org.au/~sfr/