LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   malloc(): memory corruption: in first stage compile of gcc for lfs 6.3 (https://www.linuxquestions.org/questions/linux-from-scratch-13/malloc-memory-corruption-in-first-stage-compile-of-gcc-for-lfs-6-3-a-594402/)

Skazi 10-25-2007 12:50 AM

malloc(): memory corruption: in first stage compile of gcc for lfs 6.3
 
I'm getting the following error on the first stage compile of gcc for lfs 6.3

Code:

stage1/xgcc -Bstage1/ -B/tools/i686-pc-linux-gnu/bin/ -c  -O2 -g -fomit-frame-pointer -DIN_GCC  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1.2/gcc -I../../gcc-4.1.2/gcc/. -I../../gcc-4.1.2/gcc/../include -I../../gcc-4.1.2/gcc/../libcpp/include    gtype-desc.c -o gtype-desc.o
*** glibc detected *** stage1/cc1: malloc(): memory corruption: 0x088d2e90 ***
======= Backtrace: =========
/lib/libc.so.6[0x400a2357]
/lib/libc.so.6(__libc_malloc+0x7e)[0x400a3b7e]
stage1/cc1[0x850cd19]
/lib/libc.so.6(_obstack_begin+0xc5)[0x400a75a5]
stage1/cc1[0x81223eb]
stage1/cc1[0x84501ca]
stage1/cc1[0x84505fe]
stage1/cc1[0x84507c2]
stage1/cc1[0x83d9eab]
stage1/cc1[0x83d9f6a]
stage1/cc1[0x83d9f8a]
stage1/cc1[0x80b9e6a]
stage1/cc1[0x8057bdc]
stage1/cc1[0x842358f]
stage1/cc1[0x8423724]
stage1/cc1[0x8423c81]
stage1/cc1[0x8059e13]
stage1/cc1[0x83b28eb]
stage1/cc1[0x83b3e81]
stage1/cc1[0x83b3ee9]
stage1/cc1[0x80a52d4]
/lib/libc.so.6(__libc_start_main+0xd8)[0x4004fdf8]
stage1/cc1[0x8049a91]
======= Memory map: ========
08048000-085bd000 r-xp 00000000 03:44 1474025    /mnt/lfs/sources/gcc-build/gcc/stage1/cc1
085bd000-085c2000 rw-p 00574000 03:44 1474025    /mnt/lfs/sources/gcc-build/gcc/stage1/cc1
085c2000-08a04000 rw-p 085c2000 00:00 0          [heap]
40000000-4001b000 r-xp 00000000 03:43 2125870    /lib/ld-2.5.so
4001b000-4001d000 rw-p 0001b000 03:43 2125870    /lib/ld-2.5.so
4001d000-4003a000 rw-p 4001d000 00:00 0
4003a000-40176000 r-xp 00000000 03:43 2125828    /lib/libc-2.5.so
40176000-40177000 r--p 0013c000 03:43 2125828    /lib/libc-2.5.so
40177000-40179000 rw-p 0013d000 03:43 2125828    /lib/libc-2.5.so
40179000-40603000 rw-p 40179000 00:00 0
40603000-4060d000 r-xp 00000000 03:44 1474064    /mnt/lfs/sources/gcc-build/gcc/libgcc_s.so.1
4060d000-4060e000 rw-p 00009000 03:44 1474064    /mnt/lfs/sources/gcc-build/gcc/libgcc_s.so.1
40613000-4184e000 rw-p 40613000 00:00 0
41900000-41921000 rw-p 41900000 00:00 0
41921000-41a00000 ---p 41921000 00:00 0
bffd6000-bffed000 rw-p bffd6000 00:00 0          [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0          [vdso]
gtype-desc.c: In function 'gt_pch_nx_elt_loc_list':
gtype-desc.c:1780: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [gtype-desc.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage2_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2

any ideas?

Skazi 11-03-2007 12:36 AM

Update on this issue:

I moved from Slackware 12 to the LFS LiveCD 6.3 r2130, thinking it might help. Indeed gcc compilation got much farther along, raising my hopes, but again I got a memory corruption error.

With Slackware 12 I was getting the memory corruption errors in different spots on each attempt to make. I've only tried once and gotten the below error with the LFS LiveCD as a host.

In addition, I've had intermittent, but frequent errors extracting the binutils and gcc bzips.

So, I've tried checking my disk with badblocks, and 'fsck.ext3 -vcf /dev/hdb4', but I've found no problems, so far. I've also run memtest recently, with no issues. I have to think this is some buggy hardware, because I've gotten similar issues on 2 different host distributions. However, Windows really hasn't been buggy at all, and neither have the host distributions, for that matter.

Anyways, I think I'll try a different machine.

My latest error from the LFS LiveCD, first pass compile of gcc:

Code:

stage2/xgcc -Bstage2/ -B/tools/i686-pc-linux-gnu/bin/ -c  -O2 -g -fomit-frame-pointer -DIN_GCC  -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.1.2/gcc -I../../gcc-4.1.2/gcc/. -I../../gcc-4.1.2/gcc/../include -I../../gcc-4.1.2/gcc/../libcpp/include    ../../gcc-4.1.2/gcc/c-decl.c -o c-decl.o
*** glibc detected *** stage2/cc1: malloc(): memory corruption: 0x086ac480 ***
======= Backtrace: =========
/lib/libc.so.6[0x4008b670]
/lib/libc.so.6[0x4008d6a3]
/lib/libc.so.6(malloc+0x7e)[0x4008eb8e]
stage2/cc1[0x8410149]
stage2/cc1[0x83251c1]
======= Memory map: ========
08048000-084b4000 r-xp 00000000 03:44 656830    /mnt/lfs/sources/gcc-build/gcc/stage2/cc1
084b4000-084b9000 rw-p 0046b000 03:44 656830    /mnt/lfs/sources/gcc-build/gcc/stage2/cc1
084b9000-08779000 rw-p 084b9000 00:00 0          [heap]
40000000-4001a000 r-xp 00000000 fe:00 32812      /lib/ld-2.5.1.so
4001a000-4001b000 r--p 00019000 fe:00 32812      /lib/ld-2.5.1.so
4001b000-4001c000 rw-p 0001a000 fe:00 32812      /lib/ld-2.5.1.so
4001c000-4001d000 r-xp 4001c000 00:00 0          [vdso]
4001d000-40026000 rw-p 4001d000 00:00 0
40027000-4014c000 r-xp 00000000 fe:00 32789      /lib/libc-2.5.1.so
4014c000-4014e000 r--p 00125000 fe:00 32789      /lib/libc-2.5.1.so
4014e000-4014f000 rw-p 00127000 fe:00 32789      /lib/libc-2.5.1.so
4014f000-40279000 rw-p 4014f000 00:00 0
40279000-40283000 r-xp 00000000 03:44 656855    /mnt/lfs/sources/gcc-build/gcc/libgcc_s.so.1
40283000-40284000 rw-p 00009000 03:44 656855    /mnt/lfs/sources/gcc-build/gcc/libgcc_s.so.1
4028f000-405fb000 rw-p 4028f000 00:00 0
40611000-4144c000 rw-p 40611000 00:00 0
41500000-41521000 rw-p 41500000 00:00 0
41521000-41600000 ---p 41521000 00:00 0
bf848000-bf85e000 rw-p bf848000 00:00 0          [stack]
./gt-c-decl.h: In function 'gt_pch_nx_lang_tree_node':
./gt-c-decl.h:559: internal compiler error: Aborted
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [c-decl.o] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make[1]: *** [stage3_build] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc'
make: *** [bootstrap] Error 2



All times are GMT -5. The time now is 09:14 AM.