2nd RESEND: Native build fails with malloc(): corrupted top size

John Paul Adrian Glaubitz <[email protected]>
Newsgroups gmane.linux.debian.ports.superh,gmane.linux.ports.sh.devel
Message-ID <[email protected]>
(Resend without attachments now since this seems to be blocked by the list servers)

Hi!

Since around the 5.3 release, trying to build the SH kernel natively on
my SH7786LCR evaluation board under Debian unstable with a current gcc-9
toolchain fails with errors which seem to be generated by the C library:

glaubitz@tirpitz:/srv/glaubitz/linux-5.3.15$ make clean && make
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/bin2c
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/conmakehash
make[1]: 'include/generated/machtypes.h' is up to date.
  CC      scripts/mod/empty.o
malloc(): invalid size (unsorted)
Aborted
make[1]: *** [scripts/Makefile.build:281: scripts/mod/empty.o] Error 134
make: *** [Makefile:1128: prepare0] Error 2
glaubitz@tirpitz:/srv/glaubitz/linux-5.3.15$

Even with "make V=1" it doesn't become any more obvious what's going on:

glaubitz@tirpitz:/srv/glaubitz/linux-5.3.15$ make V=1
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
Aborted
make -f ./scripts/Makefile.build obj=arch/sh/kernel/syscalls all
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/dtc
make -f ./scripts/Makefile.build obj=scripts
set -e; mkdir -p include/config/; { echo "5.3.15$(/bin/bash ./scripts/setlocalversion .)"; } > include/config/kernel.release.tmp; if [ -r include/config/kernel.release ] && cmp -s include/config/kernel.release include/config/kernel.release.tmp; then rm -f include/config/kernel.release.tmp; else : '  UPD     include/config/kernel.release'; mv -f include/config/kernel.release.tmp include/config/kernel.release; fi
make -f ./scripts/Makefile.asm-generic obj=arch/sh/include/generated/uapi/asm \
generic=include/uapi/asm-generic
make -f ./scripts/Makefile.asm-generic obj=arch/sh/include/generated/asm \
generic=include/asm-generic
set -e; mkdir -p include/generated/uapi/linux/; {       echo \#define LINUX_VERSION_CODE 328463; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'; } > include/generated/uapi/linux/version.h.tmp; if [ -r include/generated/uapi/linux/version.h ] && cmp -s include/generated/uapi/linux/version.h include/generated/uapi/linux/version.h.tmp; then rm -f include/generated/uapi/linux/version.h.tmp; else : '  UPD     include/generated/uapi/linux/version.h'; mv -f include/generated/uapi/linux/version.h.tmp include/generated/uapi/linux/version.h; fi
rm -f include/linux/version.h
set -e; mkdir -p include/generated/; {  if [ `echo -n "5.3.15" | wc -c ` -gt 64 ]; then echo '"5.3.15" exceeds 64 characters' >&2; exit 1; fi; echo \#define UTS_RELEASE \"5.3.15\"; } > include/generated/utsrelease.h.tmp; if [ -r include/generated/utsrelease.h ] && cmp -s include/generated/utsrelease.h include/generated/utsrelease.h.tmp; then rm -f include/generated/utsrelease.h.tmp; else : '  UPD     include/generated/utsrelease.h'; mv -f include/generated/utsrelease.h.tmp include/generated/utsrelease.h; fi
make -f ./scripts/Makefile.build obj=arch/sh/tools include/generated/machtypes.h
make[1]: 'include/generated/machtypes.h' is up to date.
make -f ./scripts/Makefile.build obj=scripts/mod
  gcc -Wp,-MD,scripts/mod/.empty.o.d  -nostdinc -isystem /usr/lib/gcc/sh4-linux-gnu/9/include -I./arch/sh/include -I./arch/sh/include/generated  -I./include -I./arch/sh/include/uapi -I./arch/sh/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -m4 -m4-nofpu -m4a -m4a-nofpu -ml -mno-fdpic -Wa,-isa=sh4a-up -ffreestanding -I ./arch/sh/include/cpu-sh4a -I ./arch/sh/include/cpu-sh4 -I ./arch/sh/include/cpu-common -I ./arch/sh/include/mach-common -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Wno-format-security -std=gnu89 -pipe -m4 -m4-nofpu -m4a -m4a-nofpu -ml -mno-fdpic -Wa,-isa=sh4a-up -ffreestanding -I ./arch/sh/include/cpu-sh4a -I ./arch/sh/include/cpu-sh4 -I ./arch/sh/include/cpu-common -I ./arch/sh/include/mach-common -O2 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wvla -Wno-pointer-sign     -DKBUILD_BASENAME='"empty"' -DKBUILD_MODNAME='"empty"' -c -o scripts/mod/empty.o scripts/mod/empty.c
malloc(): corrupted top size
Aborted
make[1]: *** [scripts/Makefile.build:281: scripts/mod/empty.o] Error 134
make: *** [Makefile:1128: prepare0] Error 2
glaubitz@tirpitz:/srv/glaubitz/linux-5.3.15$

From the build log history in Debian, it seems the problem showed first with 5.3-r5 [1].

However, I have tested this on an older 3.16.7 source that I have still on disk and
the problem reproduces there as well. The glibc version of builds where it fails and
where it didn't, seems to be identical [2, 3].

Does anyone have an idea what could be going on? I'm using the kernel configuration
as found in [4].

Adrian

> [1] https://buildd.debian.org/status/logs.php?pkg=linux&arch=sh4
> [2] https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sh4&ver=5.3%7Erc5-1%7Eexp1&stamp=1566686427&raw=0
> [3] https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sh4&ver=5.3%7Erc5-1%7Eexp2&stamp=1566885069&raw=0
> [4] https://people.debian.org/~glaubitz/sh4-kernel-config.txt

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [email protected]
`. `'   Freie Universitaet Berlin - [email protected]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.