ervandew / eclim

Expose eclipse features inside of vim.
http://eclim.org
GNU General Public License v3.0
1.04k stars 130 forks source link

eclim plugin causes double free #26

Closed gilligan closed 13 years ago

gilligan commented 13 years ago

I spent some time debugging MacVim and finally realized that eclim was the problem. It leads to a double free crashing vim whenever I did a :make. This however only seems to be happening in macvim. I appended some gdb output. Let me know if there is any further info I can provide.

(gdb) where

0 0x00007fff800e0491 in malloc_error_break ()

1 0x00007fff8000a603 in free ()

2 0x00000001000d8a45 in vim_free (x=0x100416b30) at misc2.c:1699

3 0x0000000100042f32 in clear_tv (varp=0x7fff5fbfe0e0) at eval.c:19214

4 0x0000000100031fc2 in get_func_tv (name=0x10047b2b0 "eclim#java#test#ResolveQuickfixResults", len=38, rettv=0x7fff5fbfe2a0, arg=0x7fff5fbfe2d8, firstline=1, lastline=1, doesrange=0x7fff5fbfe2e8, evaluate=1, selfdict=0x0) at eval.c:8145

5 0x000000010002aba2 in ex_call (eap=0x7fff5fbfe370) at eval.c:3391

6 0x000000010006143d in do_one_cmd (cmdlinep=0x7fff5fbfe5e8, sourcing=1, cstack=0x7fff5fbfe620, fgetline=0x10008f3ea , cookie=0x7fff5fbfeb20) at ex_docmd.c:2663

7 0x000000010005e03c in do_cmdline (cmdline=0x0, getline=0x10008f3ea , cookie=0x7fff5fbfeb20, flags=7) at ex_docmd.c:1129

8 0x000000010008ef10 in apply_autocmds_group (event=EVENT_QUICKFIXCMDPOST, fname=0x1004608a0 "make", fname_io=0x100414700 "Makefile", force=1, group=-3, buf=0x100861e00, eap=0x0) at fileio.c:9423

9 0x000000010008e6f3 in apply_autocmds (event=EVENT_QUICKFIXCMDPOST, fname=0x1001d9e9c "make", fname_io=0x100414700 "Makefile", force=1, buf=0x100861e00) at fileio.c:9032

10 0x0000000100123203 in ex_make (eap=0x7fff5fbfed20) at quickfix.c:2824

11 0x000000010006143d in do_one_cmd (cmdlinep=0x7fff5fbfef98, sourcing=0, cstack=0x7fff5fbfefd0, fgetline=0x10007814b , cookie=0x0) at ex_docmd.c:2663

12 0x000000010005e03c in do_cmdline (cmdline=0x0, getline=0x10007814b , cookie=0x0, flags=0) at ex_docmd.c:1129

13 0x00000001000f20b5 in nv_colon (cap=0x7fff5fbff530) at normal.c:5354

14 0x00000001000ea2d1 in normal_cmd (oap=0x7fff5fbff610, toplevel=1) at normal.c:1190

15 0x00000001000a5c9a in main_loop (cmdwin=0, noexmode=0) at main.c:1333

16 0x00000001000a578f in main (argc=1, argv=0x7fff5fbff888) at main.c:1026

(gdb) where

0 0x00007fff800e0491 in malloc_error_break ()

1 0x00007fff8000a603 in free ()

2 0x00000001000d8a45 in vim_free (x=0x100416b30) at misc2.c:1699

3 0x0000000100042f32 in clear_tv (varp=0x7fff5fbfe0e0) at eval.c:19214

4 0x0000000100031fc2 in get_func_tv (name=0x10047b2b0 "eclim#java#test#ResolveQuickfixResults", len=38, rettv=0x7fff5fbfe2a0, arg=0x7fff5fbfe2d8, firstline=1, lastline=1, doesrange=0x7fff5fbfe2e8, evaluate=1, selfdict=0x0) at eval.c:8145

5 0x000000010002aba2 in ex_call (eap=0x7fff5fbfe370) at eval.c:3391

6 0x000000010006143d in do_one_cmd (cmdlinep=0x7fff5fbfe5e8, sourcing=1, cstack=0x7fff5fbfe620, fgetline=0x10008f3ea , cookie=0x7fff5fbfeb20) at ex_docmd.c:2663

7 0x000000010005e03c in do_cmdline (cmdline=0x0, getline=0x10008f3ea , cookie=0x7fff5fbfeb20, flags=7) at ex_docmd.c:1129

8 0x000000010008ef10 in apply_autocmds_group (event=EVENT_QUICKFIXCMDPOST, fname=0x1004608a0 "make", fname_io=0x100414700 "Makefile", force=1, group=-3, buf=0x100861e00, eap=0x0) at fileio.c:9423

9 0x000000010008e6f3 in apply_autocmds (event=EVENT_QUICKFIXCMDPOST, fname=0x1001d9e9c "make", fname_io=0x100414700 "Makefile", force=1, buf=0x100861e00) at fileio.c:9032

10 0x0000000100123203 in ex_make (eap=0x7fff5fbfed20) at quickfix.c:2824

11 0x000000010006143d in do_one_cmd (cmdlinep=0x7fff5fbfef98, sourcing=0, cstack=0x7fff5fbfefd0, fgetline=0x10007814b , cookie=0x0) at ex_docmd.c:2663

12 0x000000010005e03c in do_cmdline (cmdline=0x0, getline=0x10007814b , cookie=0x0, flags=0) at ex_docmd.c:1129

13 0x00000001000f20b5 in nv_colon (cap=0x7fff5fbff530) at normal.c:5354

14 0x00000001000ea2d1 in normal_cmd (oap=0x7fff5fbff610, toplevel=1) at normal.c:1190

15 0x00000001000a5c9a in main_loop (cmdwin=0, noexmode=0) at main.c:1333

16 0x00000001000a578f in main (argc=1, argv=0x7fff5fbff888) at main.c:1026

(gdb)

ervandew commented 13 years ago

What version of macvim are you using (including patch levels)? If you're not on the latest version you may want to try upgrading.

Once I get an exact version number from you, I'll see if I can reproduce the issue.

gilligan commented 13 years ago

I was on head of the master branch of macvim on the day I filed the bug report

ervandew commented 13 years ago

So far I haven't been able to reproduce this issue with the current macvim head: $ git describe --tags snapshot-53-15-g6b59359 Can you provide a simple test case which triggers this issue?

ervandew commented 13 years ago

Actually, I can reproduce it now.

ervandew commented 13 years ago

I'm pretty sure that this commit (patch 3 on the vim source) fixes the issue: http://code.google.com/p/vim/source/detail?r=2a8bf2ba504f422d53dac30da8b58d76e54b4428

Macvim is only up to patch 2, so once they merge in the latest commit, this issue should be resolved.

gilligan commented 13 years ago

great, i will have a look into it and also forward the info to the macvim author. thanks