Date: Sun, 3 Feb 2019 16:02:30 -0800 From: Mark Millard <marklmi@yahoo.com> To: freebsd-arm <freebsd-arm@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org> Subject: Re: head -r343670 on armv7 (cortexA7): /rescue/WHATEVER gets "Segmentation fault" in my context [backtraces shows handle_static_init as the context] Message-ID: <0C8976C2-8888-4340-84A3-F0F6F46BDD6D@yahoo.com> In-Reply-To: <D38819EA-AE54-42A0-86ED-91395C479378@yahoo.com> References: <D38819EA-AE54-42A0-86ED-91395C479378@yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-Feb-3, at 13:11, Mark Millard <marklmi at yahoo.com> wrote: > I reliably get results like: >=20 > # /rescue/echo > Segmentation fault (core dumped) > # >=20 > # /rescue/tar -xpf /usr/obj/clang-armv7-installworld-poud.tar -C = /usr/obj/DESTDIRs/clang-armv7-installworld-poud > Segmentation fault (core dumped) > # >=20 > That last is what I first tried /rescue with. Using just "tar" worked = fine. > That in turn lead to trying other simple /rescue/WHATEVER commands. >=20 >=20 > (I've not yet figured out how to get debug information for rescue. > This limits the below information.) >=20 > Both fail at the same place: >=20 > # gdb /rescue/echo echo.15825.core=20 > GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD] > . . . > Reading symbols from /rescue/echo...(no debugging symbols = found)...done. > [New LWP 100179] > Core was generated by `/rescue/echo'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x0067b3f0 in ?? () > (gdb) bt > #0 0x0067b3f0 in ?? () > #1 0x0066fe28 in ?? () > #2 0x001d11f0 in ?? () > Backtrace stopped: previous frame identical to this frame (corrupt = stack?) > (gdb) disass > No function contains program counter for selected frame. >=20 >=20 > # gdb /rescue/tar tar.15819.core > GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD] > Copyright (C) 2018 Free Software Foundation, Inc. > . . . > [New LWP 100179] > Core was generated by `/rescue/tar -xpf = /usr/obj/clang-armv7-installworld-poud.tar -C /usr/obj/DESTDIRs'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x0067b3f0 in ?? () > (gdb) bt > #0 0x0067b3f0 in ?? () > #1 0x0066fe28 in ?? () > #2 0x001d11f0 in ?? () > Backtrace stopped: previous frame identical to this frame (corrupt = stack?) >=20 >=20 > The buildworld was a cross build amd64->armv7 using my historical way = of building. > amd64 itself and the amd64->aarch64 cross-build that I've also built = and installed > have rescue working fine. /usr/src/ is the same for all these builds = (diff -r -x.svn > finds no differences). >=20 >=20 > # file /rescue/echo > /rescue/echo: ELF 32-bit LSB executable, ARM, EABI5 version 1 = (FreeBSD), statically linked, for FreeBSD 13.0 (1300010), FreeBSD-style, = stripped >=20 > # uname -apKU > FreeBSD OPiP2E 13.0-CURRENT FreeBSD 13.0-CURRENT #4 r343670M: Fri Feb = 1 16:45:22 PST 2019 = markmi@FBSDFSSD:/usr/obj/armv7_clang/arm.armv7/usr/src/arm.armv7/sys/GENER= IC-NODBG arm armv7 1300010 1300010 >=20 > My GENERIC-NODBG includes the standard GENERIC one and forces various = debug things to be > disabled. >=20 > My builds do use -mcpu=3Dcortex-a7 : >=20 > # more ~/src.configs/src.conf.armv7-clang-bootstrap.amd64-host=20 > TO_TYPE=3Darmv7 > # > KERNCONF=3DGENERIC-NODBG > TARGET=3Darm > .if ${.MAKE.LEVEL} =3D=3D 0 > TARGET_ARCH=3D${TO_TYPE} > .export TARGET_ARCH > .endif > # > #WITH_CROSS_COMPILER=3D > WITH_SYSTEM_COMPILER=3D > WITH_SYSTEM_LINKER=3D > # > #CPUTYPE=3Dsoft > WITH_LIBCPLUSPLUS=3D > #WITH_LLD_BOOTSTRAP=3D > WITHOUT_BINUTILS_BOOTSTRAP=3D > WITH_ELFTOOLCHAIN_BOOTSTRAP=3D > #Disables avoiding bootstrap: WITHOUT_LLVM_TARGET_ALL=3D > WITHOUT_LLVM_TARGET_AARCH64=3D > WITH_LLVM_TARGET_ARM=3D > WITHOUT_LLVM_TARGET_MIPS=3D > WITHOUT_LLVM_TARGET_POWERPC=3D > WITHOUT_LLVM_TARGET_SPARC=3D > WITHOUT_LLVM_TARGET_X86=3D > #WITH_CLANG_BOOTSTRAP=3D > WITH_CLANG=3D > WITH_CLANG_IS_CC=3D > WITH_CLANG_FULL=3D > WITH_CLANG_EXTRAS=3D > WITH_LLD=3D > WITH_LLD_IS_LD=3D > WITHOUT_BINUTILS=3D > # > # Linking lldb fails for armv7 > WITHOUT_LLDB=3D > # > WITH_BOOT=3D > WITHOUT_LIB32=3D > # > WITHOUT_GCC_BOOTSTRAP=3D > WITHOUT_GCC=3D > WITHOUT_GCC_IS_CC=3D > WITHOUT_GNUCXX=3D > # > NO_WERROR=3D > #WERROR=3D > MALLOC_PRODUCTION=3D > # > WITH_REPRODUCIBLE_BUILD=3D > WITH_DEBUG_FILES=3D > # > XCFLAGS+=3D -mcpu=3Dcortex-a7 > XCXXFLAGS+=3D -mcpu=3Dcortex-a7 > # There is no XCPPFLAGS but XCPP gets XCFLAGS content. >=20 > I use: >=20 > # more = ~/sys_build_scripts.amd64-host/make_armv7_nodebug_clang_bootstrap-amd64-ho= st.sh=20 > kldload -n filemon && \ > script = ~/sys_typescripts/typescript_make_armv7_nodebug_clang_bootstrap-amd64-host= -$(date +%Y-%m-%d:%H:%M:%S) \ > env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" = SRC_ENV_CONF=3D"/root/src.configs/src.conf.armv7-clang-bootstrap.amd64-hos= t" \ > WITH_META_MODE=3Dyes \ > WORLD_FLAGS=3D"${WORLD_FLAGS} UBLDR_LOADADDR=3D0x42000000" \ > MAKEOBJDIRPREFIX=3D"/usr/obj/armv7_clang/arm.armv7" \ > make $* >=20 >=20 > I do not know when I last tried /rescue/SOMETHING so I've no clue > when this problem started. Plus the prior build was -r341864 or > some such so this was a fairly large jump even if I used /rescue > with my prior build/installation. I got backtraces ( /rescue/tar example first ): # gdb /rescue/tar tar.16186.core=20 GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD] . . . Reading symbols from /rescue/tar...done. [New LWP 100201] Core was generated by `/rescue/tar -xpf = /usr/obj/clang-armv7-installworld-poud.tar -C /usr/obj/DESTDIRs'. Program terminated with signal SIGSEGV, Segmentation fault. #0 thr_malloc_lock (curthread=3D0x0) at = /usr/src/lib/libthr/thread/thr_malloc.c:63 63 _thr_umutex_lock(&thr_malloc_umtx, TID(curthread)); (gdb) bt #0 thr_malloc_lock (curthread=3D0x0) at = /usr/src/lib/libthr/thread/thr_malloc.c:63 #1 __thr_calloc (num=3D1, size=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_malloc.c:82 #2 0x0066ff38 in mutex_init (mutex=3D<optimized out>, = mutex_attr=3D<optimized out>, calloc_cb=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_mutex.c:294 #3 __pthread_mutex_init (mutex=3D0xc758c8 <atomic_mtx>, = mutex_attr=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_mutex.c:393 #4 0x001d11f0 in handle_static_init (argc=3D5, argv=3D<optimized out>, = env=3D<optimized out>) at /usr/src/lib/csu/common/ignore_init.c:124 #5 0x001d10e8 in __start (argc=3D5, argv=3D<optimized out>, = env=3D<optimized out>, ps_strings=3D<optimized out>, obj=3D0x0, = cleanup=3D0x0) at /usr/src/lib/csu/arm/crt1.c:112 #6 0x001d1000 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt = stack?) Or, looking at /rescue/echo : # gdb /rescue/echo GNU gdb (GDB) 8.2 [GDB v8.2 for FreeBSD] . . . Reading symbols from /rescue/echo...done. (gdb) run Starting program: /rescue/echo=20 Program received signal SIGSEGV, Segmentation fault. __thr_calloc (num=3D1, size=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_malloc.c:82 82 thr_malloc_lock(curthread); (gdb) bt #0 __thr_calloc (num=3D1, size=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_malloc.c:82 #1 0x0066ff38 in mutex_init (mutex=3D<optimized out>, = mutex_attr=3D<optimized out>, calloc_cb=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_mutex.c:294 #2 __pthread_mutex_init (mutex=3D0xc758c8 <atomic_mtx>, = mutex_attr=3D<optimized out>) at = /usr/src/lib/libthr/thread/thr_mutex.c:393 #3 0x001d11f0 in handle_static_init (argc=3D1, argv=3D<optimized out>, = env=3D<optimized out>) at /usr/src/lib/csu/common/ignore_init.c:124 #4 0x001d10e8 in __start (argc=3D1, argv=3D<optimized out>, = env=3D<optimized out>, ps_strings=3D<optimized out>, obj=3D0x0, = cleanup=3D0x0) at /usr/src/lib/csu/arm/crt1.c:112 #5 0x001d1000 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt = stack?) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0C8976C2-8888-4340-84A3-F0F6F46BDD6D>