[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-devel:04814] Re: Bug#JP/470: netmaj_2.0.7-4 can't build



たなか(ま)です。

> > Program received signal SIGSEGV, Segmentation fault.
> > 0x805cba9 in waddbytes (win=0x80748f0, bytes=0x805d3dd "  ", count=2) at
> > addbytes.c:109
> > 109                                 } else if (win->_y[y][x] != c) {
> > 
> > lib/libcurses/addbytes.c で落ちます。
> > 
> > (gdb) print y
> > $1 = 6
> > (gdb) print x
> > $2 = 51
> > (gdb) print c
> > $3 = 32
> > (gdb) print win->_y[y][x]
> > Cannot access memory at address 0x18.
> 
>   win や _y を見ないんですか?
>   おそらくこのポインタが腐っているのでしょう。
(^^;; そうですね。
ちなみに、自宅のマシンでも現象は同じです。

(gdb) print win
$9 = (struct _win_st *) 0x806d4b8
(gdb) print win->_y
$10 = (long unsigned int **) 0x0
で、_yが腐ってるみたいです。

むつみさんと環境は同じだと思うのですが…。

tanaka@monkey:~>dpkg -l gcc binutils cpp 'termcap*' 'ncurs*' | grep '^ii'
ii  gcc             2.7.2.3-4.8    The GNU C compiler.
ii  binutils        2.9.1-0.2      The GNU assembler, linker and binary utiliti
ii  cpp             2.7.2.3-4.8    The GNU C preprocessor.
ii  termcap-compat  1.1.1.1        Compatibility package for old termcap-based 
ii  termcap1        2.0.8-1        termcap libraty
ii  termcap1-dev    2.0.8-1        termcap libraty (dev)
ii  ncurses-base    1.9.9g-8.8     Video terminal manipulation - Minimum termin
ii  ncurses-bin     1.9.9g-8.8     Video terminal manipulation - associated pro
ii  ncurses-term    1.9.9g-8.8     Video terminal manipulation - additional ter
ii  ncurses3.0      1.9.9e-2.1     Old libc5 curses - shared libraries
ii  ncurses3.4      1.9.9g-8.8     Video terminal manipulation - shared librari
ii  ncurses3.4-dev  1.9.9g-8.8     Video terminal manipulation - Developer's li

その他、直接は関係ないのですが、(長くなって、すいません)

(gdb) where
#0  0x805cba9 in waddbytes (win=0x806d4b8, bytes=0x805d3dd "  ", count=2)
    at addbytes.c:109
#1  0x804bf8d in draw_hand (gp=0x8065eb0, who=0) at cui.c:854
#2  0x804b73c in ui_draw (gp=0x8065eb0, redraw=1) at cui.c:701
#3  0x804a8ac in ui_init (gp=0x8065eb0, kind=1) at cui.c:329
#4  0x80493ea in init (gp=0x8065eb0, board=0x805cdf4 "") at client.c:75
#5  0x8049759 in main (argc=1, argv=0xbffffa0c) at client.c:161

で、#1のcui.c:854が、
    853         if (n!=14 && n!=11 && n!=8 && n!=5 && n != 2) {
    854                 addstr("   ");
    855         }
addstr()は、lib/curses.hで、
#define addstr(str)     VOID(waddbytes(stdscr, str, strlen(str)))

となっていますが、(gcc -I. -Ilib なので、/usr/include/curses.hではない)
今回落ちてる関数 waddbytes(WINDOW *win, u_char *bytes, int count)には、

Program received signal SIGSEGV, Segmentation fault.
0x805cba9 in waddbytes (win=0x806d4b8, bytes=0x805d3dd "  ", count=2)
    at addbytes.c:109
109                                 } else if (win->_y[y][x] != c) {
(gdb) print win
$1 = (struct _win_st *) 0x806d4b8
(gdb) print bytes[0]
$2 = 32 ' '
(gdb) print bytes[1]
$3 = 32 ' '
(gdb) print bytes[2]
$4 = 0 '\000'
(gdb) print count
$5 = 2

で、arg2は、スペース3つ、arg3は 3 だと思うのですが
なんか変だな?と思うのですが、
どこが悪そうとか、勘違いしてるポイントとか指摘して
戴けると助かります。よろしくお願いします。