Booting L4Re with qemu-system-arm: Panic in sigma0

Leslie Zhai lesliezhai at llvm.org.cn
Tue Oct 31 09:24:10 CET 2017


Hi L4 hackers,


$ svn info
Path: .
Working Copy Root Path: /data/project/l4re
URL: https://svn.l4re.org/repos/oc/l4re/trunk
Relative URL: ^/trunk
Repository Root: https://svn.l4re.org/repos/oc/l4re
Repository UUID: d050ee49-bd90-4346-b210-929a50b99cfc
Revision: 75
Node Kind: directory
Schedule: normal
Last Changed Author: l4check
Last Changed Rev: 75
Last Changed Date: 2017-10-15 19:49:39 +0800 (Sun, 15 Oct 2017)


My Fiasco build config:

#
# Automatically generated file; DO NOT EDIT.
# Fiasco configuration
#
CONFIG_HAS_FPU_OPTION=y
CONFIG_HAS_SERIAL_OPTION=y
CONFIG_HAS_JDB_GZIP_OPTION=y

#
# Target configuration
#
# CONFIG_IA32 is not set
# CONFIG_AMD64 is not set
CONFIG_ARM=y
# CONFIG_MIPS is not set
CONFIG_PF_INTEGRATOR=y
# CONFIG_PF_REALVIEW is not set
# CONFIG_PF_SUNXI is not set
# CONFIG_PF_BCM283X is not set
# CONFIG_PF_SA1100 is not set
# CONFIG_PF_XSCALE is not set
# CONFIG_PF_ARMADA38X is not set
# CONFIG_PF_KIRKWOOD is not set
# CONFIG_PF_TEGRA is not set
# CONFIG_PF_LAYERSCAPE is not set
# CONFIG_PF_IMX is not set
# CONFIG_PF_RCAR3 is not set
# CONFIG_PF_EXYNOS is not set
# CONFIG_PF_S3C2410 is not set
# CONFIG_PF_OMAP is not set
# CONFIG_PF_ZYNQ is not set
CONFIG_BSP_NAME="integrator"
CONFIG_CAN_ARM_CPU_926=y
CONFIG_CAN_ARM_CPU_1176=y
CONFIG_ABI_VF=y
CONFIG_ARM_926=y
# CONFIG_ARM_1176 is not set
CONFIG_FPU=y
CONFIG_ARM_ALIGNMENT_CHECK=y
CONFIG_ARM_EM_STD=y
CONFIG_ARM_CPU_ERRATA=y

#
# Kernel options
#
# CONFIG_CONTEXT_8K is not set
CONFIG_CONTEXT_4K=y
CONFIG_FINE_GRAINED_CPUTIME=y
CONFIG_SCHED_FIXED_PRIO=y
# CONFIG_SCHED_WFQ is not set
# CONFIG_SCHED_FP_WFQ is not set

#
# Debugging
#
CONFIG_INLINE=y
# CONFIG_NDEBUG is not set
# CONFIG_NO_FRAME_PTR is not set
CONFIG_STACK_DEPTH=y
CONFIG_LIST_ALLOC_SANITY=y
CONFIG_SERIAL=y
CONFIG_JDB=y
CONFIG_JDB_LOGGING=y
CONFIG_JDB_GZIP=y
# CONFIG_JDB_ACCOUNTING is not set
# CONFIG_WARN_NONE is not set
# CONFIG_WARN_WARNING is not set
CONFIG_WARN_ANY=y

#
# ARM debugging options
#
CONFIG_VMEM_ALLOC_TEST=y
CONFIG_DEBUG_KERNEL_PAGE_FAULTS=y

#
# Compiling
#
CONFIG_CC="gcc"
CONFIG_CXX="g++"
CONFIG_HOST_CC="gcc"
CONFIG_HOST_CXX="g++"
CONFIG_MAINTAINER_MODE=y
CONFIG_LABEL=""
CONFIG_EXPERIMENTAL=y
CONFIG_PERF_CNT=y
CONFIG_BIT32=y
CONFIG_WARN_LEVEL=2
CONFIG_XARCH="arm"
CONFIG_ABI="vf"


My L4Re build config:

# Automatically generated. Don't edit

BID_COMPILER_TYPE=gcc
BUILD_SYSTEMS=arm_armv5te arm_armv5te-l4f
CONFIG_ARCH_ENABLE_STACK_PROTECTOR=y
CONFIG_BID_GCC_ENABLE_STACK_PROTECTOR=y
CONFIG_BID_GCC_STACK_PROTECTOR=y
CONFIG_BUILD_ABI="l4f"
CONFIG_BUILD_ABI_l4f=y
CONFIG_BUILD_ARCH="arm"
CONFIG_BUILD_ARCH_arm=y
CONFIG_CPU_ARM_ARMV5TE=y
CONFIG_CPU="armv5te"
CONFIG_CTAGS="ctags"
CONFIG_DROPS_INSTDIR="/path/to/l4re"
CONFIG_DROPS_STDDIR="/path/to/l4re"
CONFIG_ETAGS="etags"
CONFIG_LEX="flex"
CONFIG_MAKECONFS_ADD=""
CONFIG_YACC="yacc"
GCCDIR=/usr/lib/gcc/arm-linux-gnueabi/6.1.1
GCCFORTRANAVAIL=
GCC_HAS_ATOMICS=
GCCINCFIXEDPATH=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/include-fixed
GCCLIB_EH=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/libgcc_eh.a
GCCLIB_FILE_crtbegin.o=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/crtbegin.o
GCCLIB_FILE_crtbeginS.o=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/crtbeginS.o
GCCLIB_FILE_crtbeginT.o=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/crtbeginT.o
GCCLIB_FILE_crtend.o=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/crtend.o
GCCLIB_FILE_crtendS.o=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/crtendS.o
GCCLIB_HOST=/usr/lib/gcc/arm-linux-gnueabi/6.1.1/libgcc.a
GCCLIB_S_SO=
GCCMAJORVERSION=6
GCCMINORVERSION=1
GCCNOSTACKPROTOPT=-fno-stack-protector
GCCPATCHLEVEL=1
GCCSTACKPROTALLOPT=-fstack-protector-all
GCCSTACKPROTOPT=-fstack-protector
GCCSYSLIBDIRS=-L/usr/lib/gcc/arm-linux-gnueabi/6.1.1/ 
-L/usr/lib/gcc/arm-linux-gnueabi/6.1.1/../../../../arm-linux-gnueabi/lib/arm-linux-gnueabi/6.1.1/ 
-L/usr/lib/gcc/arm-linux-gnueabi/6.1.1/../../../../arm-linux-gnueabi/lib/ 
-L/usr/arm-linux-gnu/sys-root/lib/arm-linux-gnueabi/6.1.1/ 
-L/usr/arm-linux-gnu/sys-root/lib/ 
-L/usr/arm-linux-gnu/sys-root/usr/lib/arm-linux-gnueabi/6.1.1/ 
-L/usr/arm-linux-gnu/sys-root/usr/lib/
GCCVERSION=6
HOST_SYSTEM=linux
INT_CPP_NAME=cc1
INT_CXX_NAME=cc1plus
INT_LD_NAME=arm-linux-gnu-ld
LD_EMULATION=armelf_linux_eabi
LD_GENDEP_PREFIX=LD_PRELOAD=libgendep.so 
LD_LIBRARY_PATH=/data/project/xiangzhai/l4re/l4/build-arm/tool/gendep/64:/data/project/xiangzhai/l4re/l4/build-arm/tool/gendep/32
LD_HAS_HASH_STYLE_OPTION=n
LDVERSION=227-3
include /data/project/xiangzhai/l4re/l4/build-arm/.config.indep
include /data/project/xiangzhai/l4re/l4/build-arm/.config.platform


Booting L4Re with qemu-system-arm:

$ make qemu CROSS_COMPILE=arm-linux-gnu- E=hello 
MODULE_SEARCH_PATH=/data/project/xiangzhai/l4re/kernel/fiasco/build-arm
make[1]: Entering directory '/data/project/xiangzhai/l4re/l4'
   Image size(s) in bytes:
             bootstrap_hello.elf:  1279488
   Start address: 0x1000000
   --> Build-Nr: 6
QEMU-cmd: qemu-system-arm -kernel 
/data/project/xiangzhai/l4re/l4/build-arm/images/bootstrap.elf -serial 
stdio -M integratorcp -m 256

L4 Bootstrapper
   Build: #6 Tue Oct 31 15:50:55 CST 2017, 6.1.1 20160621 (Red Hat Cross 
6.1.1-2)
   Scanning up to 256 MB RAM, starting at offset 32MB
   Memory size is 256MB (00000000 - 0fffffff)
   RAM: 0000000000000000 - 000000000fffffff: 262144kB
   Total RAM: 256MB
   Scanning fiasco
   Scanning sigma0
   Scanning moe
   Moving up to 5 modules behind 1100000
   moving module 02 { 10e7000-11284af } -> { 11d8000-12194af } [267440]
   moving module 01 { 10d5000-10e6343 } -> { 11c6000-11d7343 } [70468]
   moving module 00 { 1053000-10d4edb } -> { 1144000-11c5edb } [532188]
   moving module 04 { 1031000-1052697 } -> { 1122000-1143697 } [136856]
   moving module 03 { 100f000-1030473 } -> { 1100000-1121473 } [136308]
   Loading fiasco
   Loading sigma0
   Loading moe
   find kernel info page...
   found kernel info page (via ELF) at 2000
Regions of list 'regions'
     [     1000,      193f] {      940} Kern   fiasco
     [     2000,     8efff] {    8d000} Kern   fiasco
     [    8f000,     8f0eb] {       ec} Root   mbi_rt
     [    e0000,     eb16b] {     b16c} Sigma0 sigma0
     [    f0000,     f517b] {     517c} Sigma0 sigma0
     [   140000,    1711df] {    311e0} Root   moe
     [   180000,    18c4eb] {     c4ec} Root   moe
     [  1000000,   100e4f7] {     e4f8} Boot   bootstrap
     [  1100000,   1143fff] {    44000} Root   Module
   found kernel options (via ELF) at 3000
   Sigma0 config    ip:000e0100 sp:00000000
   Roottask config  ip:00140254 sp:00000000
   Starting kernel fiasco at 00001118
Hello from Startup::stage2
FPU: Initialize
FPU0: Subarch: 1, Part: 10, Rev: 0, Var: 9, Impl: 41

KERNEL: Warning: Buddy::alloc: Size mismatch: 1c000 v 20000
SERIAL ESC: allocated IRQ 1 for serial uart
Not using serial hack in slow timer handler.
Welcome to L4/Fiasco.OC!
L4/Fiasco.OC microkernel on arm
Rev: 362fdae-dirty compiled with gcc 6.1.1 20160621 (Red Hat Cross 
6.1.1-2) for Integrator    []
Build: #2 Tue Oct 31 15:39:15 CST 2017

Calibrating timer loop... done.
MDB: use page size: 20
MDB: use page size: 12
EXCEPTION: (00) Why undef insn? pfa=00002000, error=00000000 psr=20000110
R[0]: 00002000 00000000 00000000 000e01d0  000f0004 00002000 000f0030 
00000000
R[8]: 00000000 00000000 00000000 000f281c  000f2808 00000000 00000000 
000e01d4

KERNEL: Warning: Sigma0 raised an exception --> HALT
Panic: ...
---------------------------------------------------------------------
     CPU 0 [f001519c]: abort
jdb:


Then how to use addr2line to find the root cause? please give me some 
hint, thanks a lot!

$ arm-linux-gnu-addr2line -p -i -e bin/arm_armv5te/bootstrap.elf -a 00002000


Because 0001-Fix-invalid-initialization-in-new.patch has been already 
merged into svn trunk, so this 
http://os.inf.tu-dresden.de/pipermail/l4-hackers/2017/008111.html might 
not fix my issue, but as Sarah mentioned "looks like a compiler issue"?

$ arm-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-linux-gnueabi/6.1.1/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../gcc-6.1.1-20160621/configure --bindir=/usr/bin 
--build=x86_64-redhat-linux-gnu --datadir=/usr/share 
--disable-decimal-float --disable-dependency-tracking --disable-gold 
--disable-libgcj --disable-libgomp --disable-libmpx 
--disable-libquadmath --disable-libssp --disable-libunwind-exceptions 
--disable-shared --disable-silent-rules --disable-sjlj-exceptions 
--disable-threads --with-ld=/usr/bin/arm-linux-gnu-ld 
--enable-__cxa_atexit --enable-checking=release 
--enable-gnu-unique-object --enable-initfini-array 
--enable-languages=c,c++ --enable-linker-build-id --enable-lto 
--enable-nls --enable-obsolete --enable-plugin --enable-targets=all 
--exec-prefix=/usr --host=x86_64-redhat-linux-gnu 
--includedir=/usr/include --infodir=/usr/share/info 
--libexecdir=/usr/libexec --localstatedir=/var --mandir=/usr/share/man 
--prefix=/usr --program-prefix=arm-linux-gnu- --sbindir=/usr/sbin 
--sharedstatedir=/var/lib --sysconfdir=/etc --target=arm-linux-gnueabi 
--with-bugurl=http://bugzilla.redhat.com/bugzilla/ --with-isl 
--with-newlib --with-plugin-ld=/usr/bin/arm-linux-gnu-ld 
--with-sysroot=/usr/arm-linux-gnu/sys-root --with-system-libunwind 
--with-system-zlib --without-headers --with-tune=cortex-a8 
--with-arch=armv7-a --with-float=hard --with-fpu=vfpv3-d16 
--with-abi=aapcs-linux --enable-gnu-indirect-function 
--with-linker-hash-style=gnu
Thread model: single
gcc version 6.1.1 20160621 (Red Hat Cross 6.1.1-2) (GCC)


-- 
Regards,
Leslie Zhai - https://reviews.llvm.org/p/xiangzhai/






More information about the l4-hackers mailing list