bug-ncurses
[Top][All Lists]
Advanced

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

Re: Crash with mtr and latest ncurses


From: Dr. Werner Fink
Subject: Re: Crash with mtr and latest ncurses
Date: Tue, 11 Apr 2017 09:37:33 +0200
User-agent: Mutt/1.6.2 (2016-07-01)

On Mon, Apr 10, 2017 at 08:56:07PM -0400, Thomas Dickey wrote:
> On Mon, Apr 10, 2017 at 12:46:37PM +0200, Dr. Werner Fink wrote:
> > Hi,
> > 
> > the crash does happen in _nc_init_acs_sp() of ncurses/tinfo/lib_acs.c
> > 
> >  gdb --args ./mtr 127.0.0.1
> >  [...]
> >  (gdb) run
> >  Starting program: /home/abuild/rpmbuild/BUILD/mtr-0.87/mtr 127.0.0.1
> >  [...]
> >  Program received signal SIGSEGV, Segmentation fault.
> >  _nc_init_acs_sp (address@hidden) at ../ncurses/tinfo/lib_acs.c:95
> >  95                  real_map[j] = 0;
> >  (gdb) list
> >  90           * the mapping information in the SCREEN struct so we can 
> > decide how to
> >  91           * render it.
> >  92           */
> >  93          if (real_map != fake_map) {
> >  94              for (j = 1; j < ACS_LEN; ++j) {
> >  95                  real_map[j] = 0;
> >  96                  fake_map[j] = A_ALTCHARSET | (chtype) j;
> >  97                  if (SP_PARM)
> >  98                      SP_PARM->_screen_acs_map[j] = FALSE;
> >  99              }
> 
> hmm - I seem to recall some recent change here, but the source says it's
> been months.  I ran a quick check using the configure options I got from
> a previous discussion with you, but valgrind hasn't anything to say about
> the code, either.
> 
> Which patchdate is the breakage from?  (I'm assuming 20170408).
> When was the previous (working) version?

IMHO the breaking version is more like 20170325 even if my test was with
20170408

> 
> I see that $TERM is "xterm".
> What locale settings are you using?

As I've several bug reports here all with openSUSE Tumbleweed the ncurses 
version
seems to be newer.  Also it seems not do depend as some of the reports do use
e.g. screen as terminal (TERM=screen-256color), see boo#1033198

A simple fix/workaround would be in lib_acs.c

--- lib_acs.c
+++ lib_acs.c   2017-04-11 07:35:21.501848366 +0000
@@ -81,8 +81,12 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_S
 {
     chtype *fake_map = acs_map;
     chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map;
+    chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : NULL;
     int j;
 
+    if (!real_map)
+           real_map = fake_map;
+
     T(("initializing ACS map"));
 
     /*

nevertheless the question could be why SP_PARM->_acs_map has become NULL I 
guess ;)

> 
> >  (gdb) print real_map
> >  $1 = (chtype *) 0x0
> >  (gdb)
> >  (gdb) bt
> >  #0  _nc_init_acs_sp (address@hidden) at ../ncurses/tinfo/lib_acs.c:95
> >  #1  0x00007ffff769ea30 in _nc_setupscreen_sp (address@hidden, 
> > slines=<optimized out>, scolumns=<optimized out>, 
> >      address@hidden <_IO_2_1_stdout_>, filtered=<optimized out>, 
> > address@hidden) at ../ncurses/base/lib_set_term.c:586
> >  #2  0x00007ffff769ab81 in newterm_sp (sp=<optimized out>, address@hidden 
> > "xterm", ofp=<optimized out>, ifp=<optimized out>)
> >      at ../ncurses/base/lib_newterm.c:222
> >  #3  0x00007ffff769b0bc in newterm (address@hidden "xterm", ofp=<optimized 
> > out>, ifp=<optimized out>) at ../ncurses/base/lib_newterm.c:352
> >  #4  0x00007ffff7697276 in initscr () at ../ncurses/base/lib_initscr.c:89
> >  #5  0x0000555555559e0d in mtr_curses_open () at curses.c:700
> >  #6  0x0000555555560b11 in display_open () at display.c:101
> >  #7  0x0000555555557e81 in main (argc=<optimized out>, argv=<optimized 
> > out>) at mtr.c:779
> > 

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]