Re: SIGSEGV in /bin/sh after r322740 -> r322776 update

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Tue, 22 Aug 2017 14:59:23 +0300
On Tue, Aug 22, 2017 at 04:46:27AM -0700, David Wolfskill wrote:
> Started with:
> FreeBSD freebeast.catwhisker.org 12.0-CURRENT FreeBSD 12.0-CURRENT #445  r322740M/322745:1200040: Mon Aug 21 04:35:19 PDT 2017     root_at_freebeast.catwhisker.org:/common/S4/obj/usr/src/sys/GENERIC  amd64
> 
> After source-based update (which was uneventful):
> FreeBSD freebeast.catwhisker.org 12.0-CURRENT FreeBSD 12.0-CURRENT #446  r322776M/322778:1200041: Tue Aug 22 04:07:02 PDT 2017     root_at_freebeast.catwhisker.org:/common/S4/obj/usr/src/sys/GENERIC  amd64
> 
> Rebooted; trying "make delete-old-libs" yields:
> Segmentation fault (core dumped)
> make: "/usr/src/share/mk/bsd.compiler.mk" line 159: warning: "echo "5.0.0 5.0.0svn)" | awk -F. '{print $1 * 10000 + $2 * 100 + $3;}'" returned non-zero status
> Segmentation fault (core dumped)
> make: "/usr/src/share/mk/bsd.compiler.mk" line 164: warning: "{ echo "__FreeBSD_cc_version" | cc -E - 2>/dev/null || echo __FreeBSD_cc_version; } | sed -n '$p'" returned non-zero status
> Segmentation fault (core dumped)
> make: "/usr/src/share/mk/bsd.linker.mk" line 56: warning: Unknown linker from LD=ld: , defaulting to bfd
> Segmentation fault (core dumped)
> make: "/usr/src/share/mk/bsd.linker.mk" line 61: warning: "echo "2.17.50" |  awk -F. '{print $1 * 10000 + $2 * 100 + $3;}'" returned non-zero status
> Segmentation fault (core dumped)
> Segmentation fault (core dumped)
> make[1]: "/usr/src/share/mk/bsd.compiler.mk" line 155: Unable to determine compiler type for CC=cc.  Consider setting COMPILER_TYPE.
> *** Error code 1
> 
> Stop.
> make: stopped in /usr/src
> .ERROR_TARGET='delete-old-libs'
> .ERROR_META_FILE=''
> .MAKE.LEVEL='0'
> MAKEFILE=''
> .MAKE.MODE='normal'
> _ERROR_CMD='.PHONY'
> .CURDIR='/usr/src'
> .MAKE='make'
> .OBJDIR='/usr/obj/usr/src'
> .TARGETS='delete-old-libs'
> DESTDIR=''
> LD_LIBRARY_PATH=''
> MACHINE='amd64'
> MACHINE_ARCH='amd64'
> MAKEOBJDIRPREFIX='/usr/obj'
> MAKESYSPATH='/usr/src/share/mk'
> MAKE_VERSION='20170720'
> PATH='/sbin:/bin:/usr/sbin:/usr/bin'
> SRCTOP='/usr/src'
> OBJTOP='/usr/obj/usr/src'
> 
> 
> I actually *first* noticed the issue on my laptop -- above was my
> builld machine.  On laptop, I run xdm; entered login & password;
> screen blanked, then returned to fresh login screen.  Loggedin on
> vty, and found sh.core.  "file sh.core" said:
> 
> g1-252(11.1-S)[4] file sh.core 
> sh.core: ELF 64-bit LSB core file x86-64, version 1 (FreeBSD), FreeBSD-style, from ' /usr/local/lib/X11/xdm/Xsession'
> 
> Files affected by the update were:
> Updating '/S4/usr/src':
> A    /S4/usr/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d
> U    /S4/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c
> U    /S4/usr/src/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile
> U    /S4/usr/src/contrib/top/loadavg.h
> U    /S4/usr/src/kerberos5/libexec/kpasswdd/Makefile
> U    /S4/usr/src/lib/libc/amd64/sys/Makefile.inc
> A    /S4/usr/src/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c
> A    /S4/usr/src/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h
> U    /S4/usr/src/lib/libc/amd64/sys/amd64_get_fsbase.c
> U    /S4/usr/src/lib/libc/amd64/sys/amd64_get_gsbase.c
> U    /S4/usr/src/lib/libc/amd64/sys/amd64_set_fsbase.c
> U    /S4/usr/src/lib/libc/amd64/sys/amd64_set_gsbase.c
> U    /S4/usr/src/lib/libc/mips/Symbol.map
> U    /S4/usr/src/lib/libcompiler_rt/Makefile.inc
> U    /S4/usr/src/share/man/man7/tests.7
> U    /S4/usr/src/sys/amd64/amd64/cpu_switch.S
> U    /S4/usr/src/sys/amd64/amd64/exception.S
> U    /S4/usr/src/sys/amd64/amd64/machdep.c
> U    /S4/usr/src/sys/amd64/amd64/ptrace_machdep.c
> U    /S4/usr/src/sys/amd64/amd64/sys_machdep.c
> U    /S4/usr/src/sys/amd64/amd64/vm_machdep.c
> U    /S4/usr/src/sys/amd64/include/asmacros.h
> U    /S4/usr/src/sys/amd64/include/pcb.h
> U    /S4/usr/src/sys/arm64/arm64/swtch.S
> U    /S4/usr/src/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
> U    /S4/usr/src/sys/compat/linuxkpi/common/src/linux_rcu.c
> U    /S4/usr/src/sys/dev/qlxgbe/README.txt
> U    /S4/usr/src/sys/dev/qlxgbe/ql_boot.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_def.h
> U    /S4/usr/src/sys/dev/qlxgbe/ql_fw.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_glbl.h
> U    /S4/usr/src/sys/dev/qlxgbe/ql_hw.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_hw.h
> U    /S4/usr/src/sys/dev/qlxgbe/ql_inline.h
> U    /S4/usr/src/sys/dev/qlxgbe/ql_ioctl.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_isr.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_minidump.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_os.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_os.h
> U    /S4/usr/src/sys/dev/qlxgbe/ql_reset.c
> U    /S4/usr/src/sys/dev/qlxgbe/ql_ver.h
> U    /S4/usr/src/sys/kern/subr_smp.c
> U    /S4/usr/src/sys/mips/mips/exception.S
> U    /S4/usr/src/sys/modules/qlxgbe/Makefile
> U    /S4/usr/src/sys/netipsec/ipsec.c
> U    /S4/usr/src/sys/netipsec/ipsec.h
> U    /S4/usr/src/sys/netipsec/ipsec6.h
> U    /S4/usr/src/sys/netipsec/ipsec_output.c
> U    /S4/usr/src/sys/sys/param.h
> U    /S4/usr/src/sys/sys/smp.h
> U    /S4/usr/src/sys/ufs/ffs/ffs_softdep.c
> U    /S4/usr/src/sys/x86/x86/mp_x86.c
> U    /S4/usr/src/usr.sbin/chown/tests/chown_test.sh
> Updated to revision 322778.
> 
> lldb's notion of the backtrace was fairly non-useful:
> g1-252(11.1-S)[7] lldb -c sh.core
> (lldb) target create --core "sh.core"
> Core file '/home/david/sh.core' (x86_64) was loaded.
> (lldb) bt
> * thread #1, name = 'sh', stop reason = signal SIGSEGV
>   * frame #0: 0x0000000800b6ee08
>     frame #1: 0x0000000800000003
> (lldb) 
I am not sure how to get the interesting information with lldb,
try gdb.

Disassemble the code around the faulting %rip.  Also provide the first
100 lines of verbose dmesg of the boot on the affected machine.

Is it only /bin/sh which faults ?  Does system boot into multiuser ?
Received on Tue Aug 22 2017 - 09:59:35 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:12 UTC