Hi,

Christian Brabandt wrote:
> 
> I have been playing with the undotree() function lately. Unfortunately, 
> it didn't take long, until it crashed :(
> 
> Here is a way to reproduce it:
> 
> chrisbra t41:~/vim [1016]% vim -u NONE -N -c ':echo undotree().entries'
> Vim: Caught deadly signal ABRT
> 
> Vim: Finished.
> zsh: abort      vim -u NONE -N
> 
> Here is the backtrace:
> Program received signal SIGABRT, Aborted.
> 0xb7fe2424 in __kernel_vsyscall ()
> (gdb) bt
> #0  0xb7fe2424 in __kernel_vsyscall ()
> #1  0xb7e2e751 in raise () from /lib/i686/cmov/libc.so.6
> #2  0xb7e31b82 in abort () from /lib/i686/cmov/libc.so.6
> #3  0xb7e6522d in ?? () from /lib/i686/cmov/libc.so.6
> #4  0xb7e6f321 in ?? () from /lib/i686/cmov/libc.so.6
> #5  0xb7e70b78 in ?? () from /lib/i686/cmov/libc.so.6
> #6  0xb7e73c5d in free () from /lib/i686/cmov/libc.so.6
> #7  0x0810471c in vim_free (x=0x8221038) at misc2.c:1699
> #8  0x080711bb in list_free (l=0x8221038, recurse=1) at eval.c:5865
> #9  0x08071112 in list_unref (l=0x8221038) at eval.c:5834
> #10 0x0808199c in clear_tv (varp=0xbfffed40) at eval.c:19192
> #11 0x08082fcf in ex_echo (eap=0xbfffedc4) at eval.c:20144
> #12 0x0809c05d in do_one_cmd (cmdlinep=0xbffff1f4, sourcing=1, 
> cstack=0xbfffeef0, fgetline=0, cookie=0x0) at ex_docmd.c:2656
> #13 0x08099afa in do_cmdline (cmdline=0xbffff5bc ":echo undotree().entries", 
> getline=0, cookie=0x0, flags=11) at ex_docmd.c:1122
> #14 0x0809935a in do_cmdline_cmd (cmd=0xbffff5bc ":echo undotree().entries") 
> at ex_docmd.c:728
> #15 0x080da141 in exe_commands (parmp=0xbffff2d0) at main.c:2807
> #16 0x080d7d55 in main (argc=6, argv=0xbffff444) at main.c:885

with Vim 7.3.3 and GVim 7.3.3 on Windows 7 this results in

  Error detected while processing command line:
  E685: Internal error: tv2string()
  E685: Internal error: echo_string()
  Press ENTER or type command to continue

but neither console nor GUI version crash.

> And here is another crash, although this looks like the same crash.
> Run vim like this (it doesn't matter, whether you have persistent undo 
> information for the file you are editing):
> ~$ vim -u NONE -N
> :let a=undotree()
> :echo a.entries
> :echo a.entries
> 
> (I couldn't make a script, that "successfully" crashes).
> 
> Backtrace:
> […]
> Program received signal SIGABRT, Aborted.
> 0xb7fe2424 in __kernel_vsyscall ()
> (gdb) bt
> #0  0xb7fe2424 in __kernel_vsyscall ()
> #1  0xb7e2e751 in raise () from /lib/i686/cmov/libc.so.6
> #2  0xb7e31b82 in abort () from /lib/i686/cmov/libc.so.6
> #3  0xb7e6522d in ?? () from /lib/i686/cmov/libc.so.6
> #4  0xb7e6f321 in ?? () from /lib/i686/cmov/libc.so.6
> #5  0xb7e70b78 in ?? () from /lib/i686/cmov/libc.so.6
> #6  0xb7e73c5d in free () from /lib/i686/cmov/libc.so.6
> #7  0x0810471c in vim_free (x=0x81f6890) at misc2.c:1699
> #8  0x080711bb in list_free (l=0x81f6890, recurse=1) at eval.c:5865
> #9  0x08071112 in list_unref (l=0x81f6890) at eval.c:5834
> #10 0x0808199c in clear_tv (varp=0xbfffec30) at eval.c:19192
> #11 0x08082fcf in ex_echo (eap=0xbfffecb4) at eval.c:20144
> #12 0x0809c05d in do_one_cmd (cmdlinep=0xbffff0e4, sourcing=0, 
> cstack=0xbfffede0, fgetline=0x80ae8b5 <getexline>, cookie=0x0) at 
> ex_docmd.c:2656
> #13 0x08099afa in do_cmdline (cmdline=0x0, getline=0x80ae8b5 <getexline>, 
> cookie=0x0, flags=0) at ex_docmd.c:1122
> #14 0x08117cb7 in nv_colon (cap=0xbffff19c) at normal.c:5319
> #15 0x08111e6c in normal_cmd (oap=0xbffff24c, toplevel=1) at normal.c:1190
> #16 0x080d83af in main_loop (cmdwin=0, noexmode=0) at main.c:1260
> #17 0x080d7ebd in main (argc=4, argv=0xbffff464) at main.c:965

this first outputs

  []

and then the same two error messages. Both versions don't crash
immediately, but only after a pause of about four to five seconds. The
crash also occurs if I don't execute the second :echo command. The pause
seems to be 'updatetime' milliseconds, because if I reduce it to 1000
the crash occurs after about one second after the :echo command.

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui