Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 May 2013 10:13:15 -0400
From:      Jim Ohlstein <jim@ohlste.in>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Apparent regression in r250359
Message-ID:  <518BAEFB.5090204@ohlste.in>
In-Reply-To: <20130509053055.GM3047@kib.kiev.ua>
References:  <518A880C.3090906@ohlste.in> <20130509053055.GM3047@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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=<value optimized out>)
    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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?518BAEFB.5090204>