From owner-freebsd-stable@FreeBSD.ORG Thu May 9 14:13:18 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 44087BDE for ; Thu, 9 May 2013 14:13:18 +0000 (UTC) (envelope-from jim@ohlste.in) Received: from mail-qa0-x235.google.com (mail-qa0-x235.google.com [IPv6:2607:f8b0:400d:c00::235]) by mx1.freebsd.org (Postfix) with ESMTP id 04D089FD for ; Thu, 9 May 2013 14:13:17 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id f11so1681062qae.5 for ; Thu, 09 May 2013 07:13:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type:x-gm-message-state; bh=ohzi6ht+IkTnHXEq1RQSeegzuDKQkV+GOj4e9eYtsuY=; b=j6dwCHG6mwFQw7ljqTu8l0uYUiVViFexD8+sMJCP2lCsmwFHZ8lc+uHXB+Ls/4qsYt Llb/IgvYyy7KYED/oJ1JgynKR4uBZL5QBVdaFNgBcAbLbRni1SbA2yDu4FAiqy1BXBci F3KqaGzwx6RgpjFMmbYzmRsxKU43+d6FFHNSuh9BO9rucxJ1lzyd9dAH7bq66yHJYPOX 5CWLfg6076e4jKADpiEb6ygkgWWY8ytarMKaphseBFKdQNHqrANVMAa46/lH9w7FIdZ6 BKsLDvAqcCYdeFiTlZ0NPpqCcKDzv/g6jFcjTUBf/QkoERxylGwHdfwT/gopW6iFQXZM laCg== X-Received: by 10.49.96.104 with SMTP id dr8mr9752286qeb.43.1368108797513; Thu, 09 May 2013 07:13:17 -0700 (PDT) Received: from [192.168.1.10] (pool-74-110-99-189.nrflva.fios.verizon.net. [74.110.99.189]) by mx.google.com with ESMTPSA id i5sm3543561qaf.0.2013.05.09.07.13.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 07:13:16 -0700 (PDT) Message-ID: <518BAEFB.5090204@ohlste.in> Date: Thu, 09 May 2013 10:13:15 -0400 From: Jim Ohlstein User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130405 Thunderbird/17.0.5 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: Apparent regression in r250359 References: <518A880C.3090906@ohlste.in> <20130509053055.GM3047@kib.kiev.ua> In-Reply-To: <20130509053055.GM3047@kib.kiev.ua> Content-Type: multipart/mixed; boundary="------------040300000003010303010409" X-Gm-Message-State: ALoCoQkMYAKfzlCXvJEzUrgYX9H610aDngqrdd4TREPZcqp8TcLzpTXeAZZZ6pYKCg88nRHRpWWA Cc: freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 14:13:18 -0000 This is a multi-part message in MIME format. --------------040300000003010303010409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 05/09/13 01:30, Konstantin Belousov wrote: > On Wed, May 08, 2013 at 01:14:52PM -0400, Jim Ohlstein wrote: >> Hello, >> >> I upgraded my (custom) kernel earlier and found that multiple daemons >> (cups, hal, syslog, ntpd, csh) crashed and dumped cores at or shortly >> after boot. >> >> The error I saw several times on the console was: >> >> set_fpcontext err 22 >> >> I recompiled using the GENERIC kernel and saw the same error. >> >> >> The error appears to be in the changes made in r250359 in fpu.c, as >> r250358 boots as expected. >> > Quite weird, and the most troublesome part is that I cannot reproduce > it locally. As a temporal workaround, you could set 'hw.use_xsave=0' > at the loader prompt. The instructions below for kgdb assume that > you did not applied this workaround. > > What CPU do you have ? Please show me the verbose dmesg of the boot. # sysctl hw.model hw.model: AMD FX(tm)-8350 Eight-Core Processor dmesg to follow privately. Recompiling the kernel with a large enough 'MSGBUF_SIZE' to handle the output. > > Next, please do the following: > run 'kgdb /boot/kernel/kernel /dev/mem', and from the kgdb prompt, > do 'x/1xw use_xsave' and 'x/1xg xsave_mask'. Attached > > Also, see below. > >> # uname -a >> FreeBSD lucid-insanity 9.1-STABLE FreeBSD 9.1-STABLE #3 r250358: Wed May >> 8 11:56:43 EDT 2013 >> root@lucid-insanity:/usr/obj/usr/src/sys/GENERIC amd64 >> >> >> World and kernel are built with clang 3.2. >> >> r250359 produces the error and core dumps: >> >> Sample gdb output: >> >> # gdb cupsd cupsd.core >> GNU gdb 6.1.1 [FreeBSD] >> Copyright 2004 Free Software Foundation, Inc. >> GDB is free software, covered by the GNU General Public License, and you are >> welcome to change it and/or distribute copies of it under certain >> conditions. >> Type "show copying" to see the conditions. >> There is absolutely no warranty for GDB. Type "show warranty" for details. >> This GDB was configured as "amd64-marcel-freebsd"...(no debugging >> symbols found)... >> Core was generated by `cupsd'. >> Program terminated with signal 10, Bus error. >> Reading symbols from /usr/local/lib/libcupsmime.so.1...(no debugging >> symbols found)...done. >> Loaded symbols for /usr/local/lib/libcupsmime.so.1 >> Reading symbols from /lib/libz.so.6...done. >> Loaded symbols for /lib/libz.so.6 >> Reading symbols from /usr/lib/libssl.so.6...done. >> Loaded symbols for /usr/lib/libssl.so.6 >> Reading symbols from /lib/libcrypto.so.6...done. >> Loaded symbols for /lib/libcrypto.so.6 >> Reading symbols from /usr/local/lib/libpaper.so.2...done. >> Loaded symbols for /usr/local/lib/libpaper.so.2 >> Reading symbols from /usr/local/lib/libcups.so.2...done. >> Loaded symbols for /usr/local/lib/libcups.so.2 >> Reading symbols from /lib/libcrypt.so.5...done. >> Loaded symbols for /lib/libcrypt.so.5 >> Reading symbols from /lib/libm.so.5...done. >> Loaded symbols for /lib/libm.so.5 >> Reading symbols from /usr/local/lib/libiconv.so.3...done. >> Loaded symbols for /usr/local/lib/libiconv.so.3 >> Reading symbols from /lib/libthr.so.3...done. >> Loaded symbols for /lib/libthr.so.3 >> Reading symbols from /lib/libc.so.7...done. >> Loaded symbols for /lib/libc.so.7 >> Reading symbols from /libexec/ld-elf.so.1...done. >> Loaded symbols for /libexec/ld-elf.so.1 >> #0 0x00007ffffffff1e3 in ?? () >> [New Thread 802407400 (LWP 100450/cupsd)] >> (gdb) >> >> # gdb csh csh.core >> GNU gdb 6.1.1 [FreeBSD] >> Copyright 2004 Free Software Foundation, Inc. >> GDB is free software, covered by the GNU General Public License, and you are >> welcome to change it and/or distribute copies of it under certain >> conditions. >> Type "show copying" to see the conditions. >> There is absolutely no warranty for GDB. Type "show warranty" for details. >> This GDB was configured as "amd64-marcel-freebsd"... >> Core was generated by `csh'. >> Program terminated with signal 10, Bus error. >> Reading symbols from /lib/libncurses.so.8...done. >> Loaded symbols for /lib/libncurses.so.8 >> Reading symbols from /lib/libcrypt.so.5...done. >> Loaded symbols for /lib/libcrypt.so.5 >> Reading symbols from /lib/libc.so.7...done. >> Loaded symbols for /lib/libc.so.7 >> Reading symbols from /usr/local/lib/libiconv.so...done. >> Loaded symbols for /usr/local/lib/libiconv.so >> Reading symbols from /libexec/ld-elf.so.1...done. >> Loaded symbols for /libexec/ld-elf.so.1 >> #0 0x00007ffffffff1e3 in ?? () >> (gdb) > From the core dump above, please do > 'info registers' > then take the value from %rdi and do > 'x/2xg $rdi+0x300', > then take the first value printed (let denote it as XSAVEADDR) and do > 'x/8xg XSAVEADDR'. # gdb csh csh.core GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... Core was generated by `csh'. Program terminated with signal 10, Bus error. Reading symbols from /lib/libncurses.so.8...done. Loaded symbols for /lib/libncurses.so.8 Reading symbols from /lib/libcrypt.so.5...done. Loaded symbols for /lib/libcrypt.so.5 Reading symbols from /lib/libc.so.7...done. Loaded symbols for /lib/libc.so.7 Reading symbols from /usr/local/lib/libiconv.so...done. Loaded symbols for /usr/local/lib/libiconv.so Reading symbols from /libexec/ld-elf.so.1...done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x00007ffffffff1e3 in ?? () (gdb) info registers rax 0x16 22 rbx 0x101 257 rcx 0x7ffffffff1e3 140737488351715 rdx 0x7fffffffc980 140737488341376 rsi 0x1 1 rdi 0x7fffffffc980 140737488341376 rbp 0x7fffffffd000 0x7fffffffd000 rsp 0x7fffffffc968 0x7fffffffc968 r8 0x0 0 r9 0x19 25 r10 0x50 80 r11 0x203 515 r12 0x801460400 34381104128 r13 0x0 0 r14 0x7fffffffcfb0 140737488342960 r15 0x7fffffffcfd0 140737488342992 rip 0x7ffffffff1e3 0x7ffffffff1e3 eflags 0x10203 66051 cs 0x43 67 ss 0x3b 59 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0 (gdb) x/2xg 0x7fffffffc980+0x300 0x7fffffffcc80: 0x00007fffffffcd40 0x00000000000001c0 (gdb) x/8xg 0x00007fffffffcd40 0x7fffffffcd40: 0xffffffffffffffff 0x0000000000000000 0x7fffffffcd50: 0x0000000000000000 0x0000000000000000 0x7fffffffcd60: 0x0000000000000000 0x0000000000000000 0x7fffffffcd70: 0x0000000000000000 0x0000000000000000 (gdb) > >> >> I can produce more if anyone is interested. >> -- Jim Ohlstein --------------040300000003010303010409 Content-Type: text/plain; charset=us-ascii; name="kgdb.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kgdb.txt" # uname -a FreeBSD lucid-insanity 9.1-STABLE FreeBSD 9.1-STABLE #4 r250359: Wed May 8 12:29:28 EDT 2013 root@lucid-insanity:/usr/obj/usr/src/sys/GENERIC amd64 # # kgdb /boot/kernel/kernel /dev/mem GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... Unread portion of the kernel message buffer: <6>pid 2016 (syslogd), uid 0: exited on signal 10 (core dumped) ahcich11: SNTF 0x0001 Reading symbols from /boot/kernel/zfs.ko...Reading symbols from /boot/kernel/zfs.ko.symbols...done. done. Loaded symbols for /boot/kernel/zfs.ko Reading symbols from /boot/kernel/opensolaris.ko...Reading symbols from /boot/kernel/opensolaris.ko.symbols...done. done. Loaded symbols for /boot/kernel/opensolaris.ko Reading symbols from /boot/kernel/linux.ko...Reading symbols from /boot/kernel/linux.ko.symbols...done. done. Loaded symbols for /boot/kernel/linux.ko Reading symbols from /boot/modules/nvidia.ko...done. Loaded symbols for /boot/modules/nvidia.ko Reading symbols from /boot/kernel/linprocfs.ko...Reading symbols from /boot/kernel/linprocfs.ko.symbols...done. done. Loaded symbols for /boot/kernel/linprocfs.ko Reading symbols from /boot/kernel/pf.ko...Reading symbols from /boot/kernel/pf.ko.symbols...done. done. Loaded symbols for /boot/kernel/pf.ko #0 sched_switch (td=0xffffffff81384300, newtd=0xfffffe000d66f920, flags=) at /usr/src/sys/kern/sched_ule.c:1920 1920 cpuid = PCPU_GET(cpuid); (kgdb) x/1xw use_xsave 0x1: Error accessing memory address 0x1: Bad address. (kgdb) x/1xg xsave_mask 0x4000000000000007: Error accessing memory address 0x4000000000000007: Bad address. (kgdb) quit # --------------040300000003010303010409--