hns - 日記自動生成システム - Version 2.19.9

先月 2006年07月 来月
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2006年07月25日(火) 旧暦 [n年日記] [更新:"2006/07/26 09:33:32"]

#1 [NetBSD][macppc] /usr/bin/gdb が Segfault する

core を作ってしまうものがあったので gdb しようとすると:
ttyp6:makoto@mini 12:01:58/060725(...gas/work)> gdb gas/as-new as-new.core
GNU gdb 5.3nb1
Copyright 2002 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 "powerpc--netbsd"...
Core was generated by `as-new'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libc.so.12...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/libexec/ld.elf_so...done.
Loaded symbols for /usr/libexec/ld.elf_so
Segmentation fault (core dumped)
ttyp6:makoto@mini 12:02:40/060725(...gas/work)> 
で gdb の方はどこで落ちているかというと:
 gdb /usr/bin/gdb gdb.core
   ....(omitted) ...
#0  0x0183fd84 in decode_locdesc ()
(gdb) bt
#0  0x0183fd84 in decode_locdesc ()
#1  0x0183d43c in new_symbol ()
#2  0x01838728 in read_func_scope ()
#3  0x01838320 in read_file_scope ()
#4  0x01837ca0 in psymtab_to_symtab_1 ()
#5  0x01837a5c in dwarf2_psymtab_to_symtab ()
#6  0x018d5954 in psymtab_to_symtab ()
#7  0x018de548 in find_pc_sect_symtab ()
#8  0x018d42a8 in select_frame ()
#9  0x018092e8 in reinit_frame_cache ()
#10 0x018c6af0 in solib_add ()
#11 0x0182d490 in solib_add_stub ()
#12 0x018e9354 in do_catch_errors ()
#13 0x018e9254 in catcher ()
#14 0x018e93a0 in catch_errors ()
#15 0x0182d7c4 in core_open ()
#16 0x0189c67c in nbsd_core_open ()
#17 0x0182c7d4 in core_file_command ()
#18 0x018e93e8 in do_captured_command ()
#19 0x018e9354 in do_catch_errors ()
#20 0x018e9254 in catcher ()
#21 0x018e93a0 in catch_errors ()
#22 0x018e9434 in catch_command_errors ()
#23 0x01887914 in captured_main ()
#24 0x018e9354 in do_catch_errors ()
#25 0x018e9254 in catcher ()
#26 0x018e93a0 in catch_errors ()
#27 0x01887ca8 in gdb_main ()
#28 0x01856d0c in main ()
#29 0x01802a48 in _start ()
#30 0x41b733f0 in ?? () from /usr/libexec/ld.elf_so
(gdb) 
OS3.99.21NetBSD/macppc (TsubaiBSD)
gdb5.3nb1
gcc4.1.220060628 prerelease (NetBSD nb1 20060602)
objdump -d /usr/bin/gdb |less
0183fd14 <decode_locdesc>:
 183fd14:       7c 08 02 a6     mflr    r0
 183fd18:       94 21 fe a0     stwu    r1,-352(r1)
 183fd1c:       39 20 00 00     li      r9,0
 183fd20:       92 41 01 28     stw     r18,296(r1)
 183fd24:       3e 40 01 b9     lis     r18,441
 183fd28:       92 61 01 2c     stw     r19,300(r1)
 183fd2c:       3e 60 01 b9     lis     r19,441
 183fd30:       92 81 01 30     stw     r20,304(r1)
 183fd34:       7c b4 2b 78     mr      r20,r5
 183fd38:       92 a1 01 34     stw     r21,308(r1)
 183fd3c:       3e a0 01 b9     lis     r21,441
 183fd40:       92 c1 01 38     stw     r22,312(r1)
 183fd44:       3e c0 01 b9     lis     r22,441
 183fd48:       92 e1 01 3c     stw     r23,316(r1)
 183fd4c:       3e e0 01 b9     lis     r23,441
 183fd50:       93 01 01 40     stw     r24,320(r1)
 183fd54:       7c 98 23 78     mr      r24,r4
 183fd58:       93 21 01 44     stw     r25,324(r1)
 183fd5c:       3b 21 00 08     addi    r25,r1,8
 183fd60:       93 61 01 4c     stw     r27,332(r1)
 183fd64:       3b 60 00 00     li      r27,0
 183fd68:       90 01 01 64     stw     r0,356(r1)
 183fd6c:       38 00 00 01     li      r0,1
 183fd70:       93 41 01 48     stw     r26,328(r1)
 183fd74:       93 81 01 50     stw     r28,336(r1)
 183fd78:       93 a1 01 54     stw     r29,340(r1)
 183fd7c:       93 c1 01 58     stw     r30,344(r1)
 183fd80:       93 e1 01 5c     stw     r31,348(r1)
 183fd84:       83 43 00 00     lwz     r26,0(r3)
 183fd88:       83 c3 00 04     lwz     r30,4(r3)
 183fd8c:       2f 9a 00 00     cmpwi   cr7,r26,0
 183fd90:       91 33 a1 34     stw     r9,-24268(r19)
 183fd94:       90 15 a1 20     stw     r0,-24288(r21)
 183fd98:       91 21 00 0c     stw     r9,12(r1)
 183fd9c:       91 36 a1 24     stw     r9,-24284(r22)
 183fda0:       91 37 a1 28     stw     r9,-24280(r23)
 183fda4:       91 32 a1 30     stw     r9,-24272(r18)
 183fda8:       40 9d 00 e4     ble-    cr7,183fe8c <decode_locdesc+0x178>
gdb/dwarf2read.c
   6376 static CORE_ADDR
   6377 decode_locdesc (struct dwarf_block *blk, struct objfile *objfile,
   6378                 const struct comp_unit_head *cu_header)
    ...
   6388   i = 0;
   6389   stacki = 0;              
   6390   stack[stacki] = 0;
   6391   isreg = 0;
   6392   offreg = 0;
   6393   isderef = 0;
   6394   islocal = 0;
   6395   optimized_out = 1;
   6396
   6397   while (i < size)
万一どこが悪いと分っても gdb だけ作り直すのは大変だから pkgsrc の gdb6 でも、と思ったら、
ERROR: privilege-escalation vulnerability in gdb-6.2.1nb3 - see http://secunia.com/advisories/15449/ for more information
gdb<6.3
ERROR: Define ALLOW_VULNERABLE_PACKAGES if this package is absolutely essential
6.4 が出たのはかなり古い話の気がする。 patch の数が 40 もあると、それを上げるというのも ..
ttyp6:makoto@mini 12:27:37/060725(...devel/gdb6)> ls patches/|wc
      40      40     356
src の方に gdb6 が用意されている。そちらは 6.4 のようだ。
cat src/gnu/dist/gdb6/gdb/version.in 
6.4
   268  12:32   tar zxf $DISTFILES/gdb-6.4.tar.bz2
   269  12:33   mkdir gdb-6.4-work
   270  12:33   cd gdb-6.4-work
   271  12:33   ../gdb-6.4/configure
   272  12:33   time make

481.843u 125.106s 10:31.90 96.0%        0+0k 119+15385io 135pf+21w
                make install
                env PATH=/usr/local/bin:${PATH} gdb gas/as-new as-new.core	    
こっちは動いた。

/etc/mk.conf に

HAVE_GDB=	6 
と書いておけば、gdb6 になる。 src/gnu/usr.bin/Makefile より。
     19 .if ${MKGDB} != "no"
     20 .if ${HAVE_GDB} == "5"
     21 SUBDIR+=        gdb53
     22 .else
     23 SUBDIR+=        gdb6
     24 .endif
     25 .endif
でも、見る限り、何の設定もない場合、gdb6 に行くような ? どこかに HAVE_GDB= 5 って書いてあるのかな。



最近の日記
2024年03月10日
停電 (瞬電)
2024年03月03日
the second try on bare-metal
useradd
2024年02月29日
opendkim and senmail
2024年01月24日
chat/iam 0.0.8
2024年01月21日
uselocale vs setlocale (textproc/R-readxl)
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)