Re: core dump in cvsup caused by _once()?

From: Sean C. Farley <scf_at_FreeBSD.org>
Date: Tue, 1 Dec 2009 16:31:50 -0600 (CST)
On Tue, 1 Dec 2009, Kostik Belousov wrote:

> On Tue, Dec 01, 2009 at 12:59:25PM -0600, Sean C. Farley wrote:
>> On Tue, 1 Dec 2009, John Baldwin wrote:
>>> On Saturday 28 November 2009 5:15:01 am Gary Jennejohn wrote:
>>>> Since I installed a new world and kernel on November 26 I'm seeing 
>>>> core dumps with cvsup, even though I reinstalled cvsup yesterday.

I just want to note that Gary and my problems may not necessarily be related.
They just happened in the same program package (cvsup).  His is with cvsup and
mine is with cvsupd.  However, both look related since they are getting SIGILL
and are calling time functions in libc.

>> BTW, I noticed the m3 call ThreadPosix__DetermineContext(), yet 
>> cvsupd is not linked against a thread library.  The amd64 binary is 
>> linked to libz, libm and libc.  The i386 binary links against those 
>> as well as libutil and libmd.
>
> Could you, please, also recompile rtld with debugging symbols ?
>
> SIGILL might be generated by kernel when signal frame cannot be copied 
> out to usermode stack. Check out the registers content and size of 
> stack too.

In what detail and how to print with gdb, do you need the registers and stack
size?  Here are the registers for frame #1.
(gdb) info registers
rax            0x4      4
rbx            0x8005ef230      34365960752
rcx            0x71bfc8 7454664
rdx            0x71bb40 7453504
rsi            0x2      2
rdi            0xb      11
rbp            0x4a9    0x4a9
rsp            0x71c038 0x71c038
r8             0x8005ef230      34365960752
r9             0x1      1
r10            0x0      0
r11            0x985    2437
r12            0x8005ed600      34365953536
r13            0x0      0
r14            0x800941c08      34369444872
r15            0x80094b88d      34369484941
rip            0x8005c167b      0x8005c167b <find_symdef+315>
eflags         0x10216  66070
cs             0x43     67
ss             0x3b     59
ds             0x0      0
es             0x0      0
fs             0x0      0
gs             0x0      0

New stack trace with more debugging:
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 `cvsupd'.
Program terminated with signal 4, Illegal instruction.
Reading symbols from /lib/libz.so.5...done.
Loaded symbols for /lib/libz.so.5
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/FreeBSD/branches/stable/8/src/lib/libc/libc.so.7...done.
Loaded symbols for /usr/FreeBSD/branches/stable/8/src/lib/libc/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  symlook_default (name=0xb <Address 0xb out of bounds>, hash=2, refobj=0x71bb40, defobj_out=0x71bfc8, ventry=0x8005ef230, flags=1) at rtld.c:2611
2611	{
(gdb) where
#0  symlook_default (name=0xb <Address 0xb out of bounds>, hash=2, refobj=0x71bb40, defobj_out=0x71bfc8, ventry=0x8005ef230, flags=1) at rtld.c:2611
#1  0x00000008005c167b in find_symdef (symnum=1193, refobj=0x8005ed600, defobj_out=0x71c0a0, flags=1, cache=0x0) at rtld.c:1206
#2  0x00000008005c1753 in _rtld_bind (obj=0x8005ed600, reloff=Variable "reloff" is not available.
) at rtld.c:578
#3  0x00000008005be8cd in _rtld_bind_start () at /usr/FreeBSD/branches/stable/8/src/libexec/rtld-elf/amd64/rtld_start.S:99
#4  0x0000000000000985 in ?? ()
#5  0x0000000000000000 in ?? ()
#6  0x0000000000000006 in ?? ()
#7  0x0000000000000043 in ?? ()
#8  0x000000000072aba8 in ?? ()
#9  0x0000000800a368e1 in _nsyycheck () from /usr/FreeBSD/branches/stable/8/src/lib/libc/libc.so.7
#10 0x000000000072abbb in ?? ()
#11 0x0000000000008000 in ?? ()
#12 0x000000000072abbe in ?? ()
#13 0x0000000000000216 in ?? ()
#14 0x0000000000000000 in ?? ()
#15 0x00000008005ed600 in ?? ()
#16 0x0000000000000161 in ?? ()
#17 0x0000000800a09049 in tzload (name=0x800a368e1 "posixrules", sp=0x7353b8, doextend=0) at /usr/FreeBSD/branches/stable/8/src/lib/libc/stdtime/localtime.c:422
#18 0x0000000800a08a1e in tzparse (name=0x72b1cd "CDT,M3.2.0,M11.1.0", sp=0x7353b8, lastditch=Variable "lastditch" is not available.
) at /usr/FreeBSD/branches/stable/8/src/lib/libc/stdtime/localtime.c:1003
#19 0x0000000800a096f6 in tzload (name=Variable "name" is not available.
) at /usr/FreeBSD/branches/stable/8/src/lib/libc/stdtime/localtime.c:580
#20 0x0000000800a09a86 in tzsetwall_basic (rdlocked=1) at /usr/FreeBSD/branches/stable/8/src/lib/libc/stdtime/localtime.c:1229
#21 0x0000000800a09deb in mktime (tmp=0x739ff8) at /usr/FreeBSD/branches/stable/8/src/lib/libc/stdtime/localtime.c:2119
#22 0x00000000004ae085 in Date__ToTime (M3_D5xROs_d=0x5eed80) at DateBsd.m3:77
#23 0x00000000004709dc in TimeStamp__Init () at TimeStamp.m3:46
#24 0x0000000000470aa2 in TimeStamp__New (M3_CD9pHn__result=0x73a1c8) at TimeStamp.m3:60
#25 0x000000000046fc1e in Random__RandomSeed () at Random.m3:67
#26 0x000000000046fab2 in Random__Init (M3_B04YLH_t=0x756d88, M3_AicXUJ_fixed=0 '\0') at Random.m3:42
#27 0x000000000044b9d5 in SortedRCSDeltaTbl__Init (M3_EKdMGR_tbl=0x756d48) at SortedTable.mg:106
#28 0x0000000000450d99 in RCSFile__Init (M3_BcmbT8_rf=0x756be0, M3_Bjvku1_desc=0x756c90) at RCSFile.m3:483
#29 0x00000000004510c2 in RCSFile__OpenReadonly (M3_Bd56fi_p=0x756a88) at RCSFile.m3:574
#30 0x000000000046305f in Attic__RCSFileOpenReadonly (M3_DMtSqf_path=0x73b3f8) at Attic.m3:120
#31 0x00000000004166bc in RCSComp__CheckoutSend (M3_BQOzaz_self=0x65a610, M3_CzVV2w_sfr=0x65e300, M3_Bd56fi_name=0x7569c8, M3_Bd56fi_tag=0x651a00, M3_Bd56fi_date=0x651a00,
     M3_AicXUJ_deleteIfDead=0 '\0', M3_AicXUJ_isFixup=0 '\0') at RCSComp.m3:1715
#32 0x000000000040d08a in RCSComp__CompCollection (M3_BQOzaz_self=0x65a610, M3_CzVV2w_sfr=0x65e300) at RCSComp.m3:238
#33 0x000000000040c4d8 in RCSComp__CompBatch (M3_BQOzaz_self=0x65a610) at RCSComp.m3:155
#34 0x000000000040bc90 in RCSComp__Apply (M3_BQOzaz_self=0x65a610) at RCSComp.m3:78
#35 0x00000000004a7240 in ThreadPosix__DetermineContext (M3_AJWxb1_oldSP=0x35) at ThreadPosix.m3:1127
#36 0x0000000000689058 in ?? ()
#37 0x00007fffffffe0a0 in ?? ()
#38 0x000000000049c68c in RTMisc__Align (M3_AJWxb1_a=Cannot access memory at address 0x64c
) at RTMisc.m3:31
Previous frame inner to this frame (corrupt stack?)
(gdb) frame 0
#0  symlook_default (name=0xb <Address 0xb out of bounds>, hash=2, refobj=0x71bb40, defobj_out=0x71bfc8, ventry=0x8005ef230, flags=1) at rtld.c:2611
2611	{
(gdb) l
2606	 * defining object via the reference parameter DEFOBJ_OUT.
2607	 */
2608	static const Elf_Sym *
2609	symlook_default(const char *name, unsigned long hash, const Obj_Entry *refobj,
2610	    const Obj_Entry **defobj_out, const Ver_Entry *ventry, int flags)
2611	{
2612	    DoneList donelist;
2613	    const Elf_Sym *def;
2614	    const Elf_Sym *symp;
2615	    const Obj_Entry *obj;
(gdb) x/i $rip
0x8005c0e30 <symlook_default+32>:	mov    %rdi,0xffffffffffffffa0(%rbp)
(gdb) quit

Here is information from frame #1.
(gdb) frame 1
#1  0x00000008005c167b in find_symdef (symnum=1193, refobj=0x8005ed600, defobj_out=0x71c0a0, flags=1, cache=0x0) at rtld.c:1206
1206            def = symlook_default(name, hash, refobj, &defobj, ventry, flags);
(gdb) info frame
Stack level 1, frame at 0x71c098:
  rip = 0x8005c167b in find_symdef (rtld.c:1206); saved rip 0x8005c1753
  called by frame at 0x71c0d8, caller of frame at 0x71c038
  source language c.
  Arglist at 0x71c030, args: symnum=1193, refobj=0x8005ed600, defobj_out=0x71c0a0, flags=1, cache=0x0
  Locals at 0x71c030, Previous frame's sp is 0x71c098
  Saved registers:
   rbx at 0x71c060, rbp at 0x71c068, r12 at 0x71c070, r13 at 0x71c078, r14 at 0x71c080, r15 at 0x71c088, rip at 0x71c090

I find this interesting.  The call to strcat() on the preceding line worked.
(gdb) p name
$2 = 0x80094b88d "strcat"

Sean
-- 
scf_at_FreeBSD.org
Received on Tue Dec 01 2009 - 21:31:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC