I don't know if it's supported to do this, but I'm crashing VIm70g,
WinXP by doing a "new" in a "TabEnter" autocommand.  The crash doesn't
immediately follow the "new" command, but soon after when other
functions start looking through the windows.

I can't get a crash in a test case, but if you run the script below,
and if you   :tabnext   5-10 times, you can see it getting real
confused about the windows (i.e. can't   :wincmd w    to some of them,
can't quit some of them).

I've included a gdb backtrace from Vim70g03.  It looks like the window
list variables have been broken in eval.c.

P.S.  What I'm trying to do is open a window
conditionally/automatically when entering a tab.  Is there a better
way other than TabEnter?


aug Tst_aug
        au!
        "au BufEnter * call Tst_BufEnter()
        "au BufLeave * call Tst_BufLeave()
        au WinEnter * call Tst_WinEnter()
        "au WinLeave * call Tst_WinLeave()
        au TabEnter * call Tst_TabEnter()
        au TabLeave * call Tst_TabLeave()
aug end

function! Tst_WinEnter()
        for winnr in range(1, winnr("$"))
                echomsg 'winnr=' . winnr
        endfor
endfunction

function! Tst_TabEnter()
        echomsg 'tabenter'
        new
endfunction

function! Tst_TabLeave()
        echomsg 'tableave'
endfunction





eval.c:15634
        for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
                                              wp != twin; wp = wp->w_next)


(gdb) backtrace
#0  0x004325a8 in get_winnr (tp=0x3eb820, argvar=0x22d3b0) at eval.c:15634
#1  0x00432eb7 in f_winnr (argvars=0x22d3b0, rettv=0x22d6f8) at eval.c:16108
#2  0x00427b11 in call_func (name=0x177766f "winnr", len=5, rettv=0x22d6f8,
   argcount=1, argvars=0x22d3b0, firstline=248, lastline=248,
   doesrange=0x22d4ec, evaluate=1, selfdict=0x0) at eval.c:7540
#3  0x004276b9 in get_func_tv (name=0x177766f "winnr", len=5, rettv=0x22d6f8,
   arg=0x22d7e0, firstline=248, lastline=248, doesrange=0x22d4ec,
   evaluate=1, selfdict=0x0) at eval.c:7358
#4  0x00423e61 in eval7 (arg=0x22d7e0, rettv=0x22d6f8, evaluate=1)
   at eval.c:4648
#5  0x00423a08 in eval6 (arg=0x22d7e0, rettv=0x22d6f8, evaluate=1)
   at eval.c:4417
#6  0x0042370e in eval5 (arg=0x22d7e0, rettv=0x22d6f8, evaluate=1)
   at eval.c:4286
#7  0x0042307c in eval4 (arg=0x22d7e0, rettv=0x22d780, evaluate=1)
   at eval.c:4088
#8  0x00422cbf in eval3 (arg=0x22d7e0, rettv=0x22d780, evaluate=1)
   at eval.c:3930
#9  0x00422c12 in eval2 (arg=0x22d7e0, rettv=0x22d810, evaluate=1)
   at eval.c:3883
#10 0x00422969 in eval1 (arg=0x22d7e0, rettv=0x22d810, evaluate=1)
   at eval.c:3784
#11 0x004228c1 in eval0 (
   arg=0x1777650 "test_winnr < 1 || test_winnr > winnr", rettv=0x22d810,
   nextcmd=0x22d864, evaluate=1) at eval.c:3741
#12 0x0041e8d5 in eval_to_bool (
   arg=0x1777650 "test_winnr < 1 || test_winnr > winnr", error=0x22d840,
   nextcmd=0x22d864, skip=0) at eval.c:1135
#13 0x0045ab77 in ex_else (eap=0x22d860) at ex_eval.c:998
#14 0x0044cd8f in do_one_cmd (cmdlinep=0x22ddc8, sourcing=1, cstack=0x22d9e0,
   getline=0x439498 <get_func_line>, cookie=0x22ddf0) at ex_docmd.c:2609
#15 0x0044a9a2 in do_cmdline (cmdline=0x0, getline=0x439498 <get_func_line>,
   cookie=0x22ddf0, flags=7) at ex_docmd.c:1095
#16 0x00438e16 in call_user_func (fp=0x178cb18, argcount=1, argvars=0x22e3f0,
---Type <return> to continue, or q <return> to quit---
   rettv=0x22e850, firstline=248, lastline=248, selfdict=0x0) at eval.c:19804
#17 0x00427a35 in call_func (name=0x14d8a07 "GetWinAdjacent", len=14,
   rettv=0x22e850, argcount=1, argvars=0x22e3f0, firstline=248,
   lastline=248, doesrange=0x22e52c, evaluate=1, selfdict=0x0) at eval.c:7511
#18 0x004276b9 in get_func_tv (name=0x14d8a07 "GetWinAdjacent", len=14,
   rettv=0x22e850, arg=0x22e820, firstline=248, lastline=248,
   doesrange=0x22e52c, evaluate=1, selfdict=0x0) at eval.c:7358
#19 0x00423e61 in eval7 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:4648
#20 0x00423a08 in eval6 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:4417
#21 0x0042370e in eval5 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:4286
#22 0x00422e79 in eval4 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:4018
#23 0x00422cbf in eval3 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:3930
#24 0x00422b3d in eval2 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:3859
#25 0x00422969 in eval1 (arg=0x22e820, rettv=0x22e850, evaluate=1)
   at eval.c:3784
#26 0x004228c1 in eval0 (arg=0x14d8a07 "GetWinAdjacent", rettv=0x22e850,
   nextcmd=0x22e8a4, evaluate=1) at eval.c:3741
#27 0x0041e8d5 in eval_to_bool (arg=0x14d8a07 "GetWinAdjacent",
   error=0x22e884, nextcmd=0x22e8a4, skip=0) at eval.c:1135
#28 0x0045a8df in ex_if (eap=0x22e8a0) at ex_eval.c:884
#29 0x0044cd8f in do_one_cmd (cmdlinep=0x22ee08, sourcing=1, cstack=0x22ea20,
   getline=0x44b4c4 <get_loop_line>, cookie=0x22ed80) at ex_docmd.c:2609
#30 0x0044a9a2 in do_cmdline (cmdline=0x0, getline=0x439498 <get_func_line>,
   cookie=0x22ee30, flags=7) at ex_docmd.c:1095
#31 0x00438e16 in call_user_func (fp=0x1762330, argcount=0, argvars=0x22f430,
   rettv=0x22f560, firstline=248, lastline=248, selfdict=0x0) at eval.c:19804
#32 0x00427a35 in call_func (name=0x14a5c38 "WinWalkerMenu", len=13,
   rettv=0x22f560, argcount=0, argvars=0x22f430, firstline=248,
---Type <return> to continue, or q <return> to quit---
   lastline=248, doesrange=0x22f558, evaluate=1, selfdict=0x0) at eval.c:7511
#33 0x004276b9 in get_func_tv (name=0x14a5c38 "WinWalkerMenu", len=13,
   rettv=0x22f560, arg=0x22f57c, firstline=248, lastline=248,
   doesrange=0x22f558, evaluate=1, selfdict=0x0) at eval.c:7358
#34 0x00421b2a in ex_call (eap=0x22f5a0) at eval.c:3175
#35 0x0044cd8f in do_one_cmd (cmdlinep=0x22fb08, sourcing=0, cstack=0x22f720,
   getline=0x45f89d <getexline>, cookie=0x0) at ex_docmd.c:2609
#36 0x0044a9a2 in do_cmdline (cmdline=0x0, getline=0x45f89d <getexline>,
   cookie=0x0, flags=0) at ex_docmd.c:1095
#37 0x004beb89 in nv_colon (cap=0x22fb60) at normal.c:5149
#38 0x004b8564 in normal_cmd (oap=0x22fc30, toplevel=1) at normal.c:1137
#39 0x0047f4ff in main_loop (cmdwin=0, noexmode=0) at main.c:1140
#40 0x0047f16b in VimMain (argc=1, argv=0x3e2840) at main.c:930
#41 0x00565803 in WinMain (hInstance=0x400000, hPrevInst=0x0,
   lpszCmdLine=0x251f12 "", nCmdShow=10) at os_w32exe.c:125
#42 0x005692ba in main ()
   at /usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../include/w32api/objbase.h:7
6

Reply via email to