Cesar Romani wrote:
> >> Dominique Pellé wrote: > > ... > >>> When putting a breakpoint at line term.c:1615, > >>> what is the value of 'term' variable? (output of gdb command: print > term) > >>> > >>> Ex: > >>> > >>> (gdb) p term > >>> $1 = (char_u *) 0x946e25c "xterm-256color" > >> $1 = (char_u *) 0xa0158c0 "msys" > >> > >>> What is also the value of 'term' later at line 1866 where it crashes? > >> $1 = (char_u *) 0x3a6c3532 <Address 0x3a6c3532 out of bounds> > >> > >>> Output of gdb command "bt full" might also be helpful. > >> -------------------- > >> (gdb) bt full > >> #0 0x004fd3a2 in set_termname ( > >> term=0x3a6c3532 <Address 0x3a6c3532 out of bounds>) at term.c:1866 > >> termp = (struct builtin_term *) 0x22f860 > >> builtin_first = 1 > >> try = 2 > >> termcap_cleared = 1 > >> width = 80 > >> height = 25 > >> error_msg = (char_u *) 0x0 > >> bs_p = (char_u *) 0x22f860 ":\017R" > >> del_p = (char_u *) 0x3a6c3532 <Address 0x3a6c3532 out of bounds> > >> #1 0x3f5b455c in ?? () > >> No symbol table info available. > >> #2 0x3a6c3532 in ?? () > >> No symbol table info available. > >> ... > >> #189 0x00000000 in ?? () > >> No symbol table info available. > >> -------------------- > > > > I can't see any place where 'term' variable would be changed > > other than when it's set to DEFAULT_TERM at line 1816 (but > > that would not cause 'term' pointer to be incorrect). > > > > So it leaves the possibility of a corrupted stack. > > > > Can you put intermediate breakpoints (or execute line by line with > > the "next" gdb command if you prefer) between line term.c:1615 > > (where 'term' pointer is still OK) and line term.c:1866 where 'term' > > pointer becomes invalid so we can narrow it down? At each steps, > > you can do "print term" in gdb to see when 'term' pointer starts to > > become "out of bounds". > > -------------------- > Breakpoint 1, set_termname (term=0xa0158c0 "msys") at term.c:1615 > 1615 if (term_is_builtin(term)) > (gdb) p term > $1 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1634 for (try = builtin_first ? 0 : 1; try < 3; ++try) > (gdb) p term > $2 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1639 if (try == 1) > (gdb) p term > $3 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1762 if (try == 2 && builtin_first && termcap_cleared) > (gdb) p term > $4 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1768 termp = find_builtin_term(term); > (gdb) p term > $5 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1769 if (termp->bt_string == NULL) /* did not find > it */ > (gdb) p term > $6 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1779 if (try == 0) /* try external > one */ > (gdb) p term > $7 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1780 continue; > (gdb) p term > $8 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1634 for (try = builtin_first ? 0 : 1; try < 3; ++try) > (gdb) p term > $9 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1639 if (try == 1) > (gdb) p term > $10 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1675 if ((error_msg = tgetent_error(tbuf, term)) == NULL) > (gdb) p term > $11 = (char_u *) 0xa0158c0 "msys" > (gdb) n > 1677 tp = tstrbuf; > (gdb) p term > $12 = (char_u *) 0x5b455c3d <Address 0x5b455c3d out of bounds> > -------------------- So tgetent_error() overwrites "term". Try increasing the value for TBUFSZ in vim.h. Check the documentation for tgetent() to find out what the value should be. My manpage doesn't say anything... -- hundred-and-one symptoms of being an internet addict: 4. Your eyeglasses have a web site burned in on them. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---