r792 - in /trunk/packages/vim: debian/README debian/changelog
upstream/patches/7.0.134 upstream/patches/7.0.135
jamessan at users.alioth.debian.org
jamessan at users.alioth.debian.org
Mon Oct 16 13:23:07 UTC 2006
Author: jamessan
Date: Mon Oct 16 13:23:06 2006
New Revision: 792
URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=792
Log:
Upstream patches 134 and 135
Added:
trunk/packages/vim/upstream/patches/7.0.134
trunk/packages/vim/upstream/patches/7.0.135
Modified:
trunk/packages/vim/debian/README
trunk/packages/vim/debian/changelog
Modified: trunk/packages/vim/debian/README
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/debian/README?rev=792&op=diff
==============================================================================
--- trunk/packages/vim/debian/README (original)
+++ trunk/packages/vim/debian/README Mon Oct 16 13:23:06 2006
@@ -158,3 +158,5 @@
2632 7.0.131 Win32: "vim -r" does not find swap files starting with a dot
2163 7.0.132 (after 7.0.130) crash when reading from stdin
3189 7.0.133 too many messages in history when searching included files
+ 2290 7.0.134 crash when trying to compare recusively looped List or Dict
+ 10022 7.0.135 crash in garbage collector with recusively looped List/Dict
Modified: trunk/packages/vim/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/debian/changelog?rev=792&op=diff
==============================================================================
--- trunk/packages/vim/debian/changelog (original)
+++ trunk/packages/vim/debian/changelog Mon Oct 16 13:23:06 2006
@@ -1,7 +1,7 @@
-vim (1:7.0-133+1) unstable; urgency=low
+vim (1:7.0-135+1) unstable; urgency=low
[ Debian Vim Maintainers ]
- * New upstream patches (123 - 133), see README.gz for details.
+ * New upstream patches (123 - 135), see README.gz for details.
[ James Vega ]
* Bump vim-common's priority to important to match the override.
@@ -16,7 +16,7 @@
* Added patch dosini.vim-hash_comment.diff which add support for # comments
in dosini syntax highlighting, thanks to Adeodato Simó. (closes: #378952)
- -- James Vega <jamessan at debian.org> Mon, 16 Oct 2006 09:20:57 -0400
+ -- James Vega <jamessan at debian.org> Mon, 16 Oct 2006 09:23:25 -0400
vim (1:7.0-122+1) unstable; urgency=medium
Added: trunk/packages/vim/upstream/patches/7.0.134
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/upstream/patches/7.0.134?rev=792&op=file
==============================================================================
--- trunk/packages/vim/upstream/patches/7.0.134 (added)
+++ trunk/packages/vim/upstream/patches/7.0.134 Mon Oct 16 13:23:06 2006
@@ -1,0 +1,83 @@
+To: vim-dev at vim.org
+Subject: Patch 7.0.134
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.134
+Problem: Crash when comparing a recursively looped List or Dictionary.
+Solution: Limit recursiveness for comparing to 1000.
+Files: src/eval.c
+
+
+*** ../vim-7.0.133/src/eval.c Tue Oct 10 12:56:09 2006
+--- src/eval.c Sun Oct 15 15:08:13 2006
+***************
+*** 5520,5538 ****
+ {
+ char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN];
+ char_u *s1, *s2;
+
+! if (tv1->v_type != tv2->v_type)
+ return FALSE;
+
+ switch (tv1->v_type)
+ {
+ case VAR_LIST:
+! /* recursive! */
+! return list_equal(tv1->vval.v_list, tv2->vval.v_list, ic);
+
+ case VAR_DICT:
+! /* recursive! */
+! return dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic);
+
+ case VAR_FUNC:
+ return (tv1->vval.v_string != NULL
+--- 5520,5546 ----
+ {
+ char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN];
+ char_u *s1, *s2;
++ static int recursive = 0; /* cach recursive loops */
++ int r;
+
+! /* Catch lists and dicts that have an endless loop by limiting
+! * recursiveness to 1000. */
+! if (tv1->v_type != tv2->v_type || recursive >= 1000)
+ return FALSE;
+
+ switch (tv1->v_type)
+ {
+ case VAR_LIST:
+! ++recursive;
+! r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic);
+! --recursive;
+! return r;
+
+ case VAR_DICT:
+! ++recursive;
+! r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic);
+! --recursive;
+! return r;
+
+ case VAR_FUNC:
+ return (tv1->vval.v_string != NULL
+*** ../vim-7.0.133/src/version.c Sat Oct 14 14:33:21 2006
+--- src/version.c Sun Oct 15 15:03:30 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 134,
+ /**/
+
+--
+It was recently discovered that research causes cancer in rats.
+
+ /// Bram Moolenaar -- Bram at 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 ///
Added: trunk/packages/vim/upstream/patches/7.0.135
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/upstream/patches/7.0.135?rev=792&op=file
==============================================================================
--- trunk/packages/vim/upstream/patches/7.0.135 (added)
+++ trunk/packages/vim/upstream/patches/7.0.135 Mon Oct 16 13:23:06 2006
@@ -1,0 +1,362 @@
+To: vim-dev at vim.org
+Subject: Patch 7.0.135
+Fcc: outbox
+From: Bram Moolenaar <Bram at moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.0.135
+Problem: Crash when garbage collecting list or dict with loop.
+Solution: Don't use DEL_REFCOUNT but don't recurse into Lists and
+ Dictionaries when freeing them in the garbage collector.
+ Also add allocated Dictionaries to the list of Dictionaries to
+ avoid leaking memory.
+Files: src/eval.c, src/proto/eval.pro, src/tag.c
+
+
+*** ../vim-7.0.134/src/eval.c Sun Oct 15 15:10:08 2006
+--- src/eval.c Sun Oct 15 22:30:09 2006
+***************
+*** 191,198 ****
+ #define FC_RANGE 2 /* function accepts range */
+ #define FC_DICT 4 /* Dict function, uses "self" */
+
+- #define DEL_REFCOUNT 999999 /* list/dict is being deleted */
+-
+ /*
+ * All user-defined functions are found in this hashtable.
+ */
+--- 191,196 ----
+***************
+*** 435,441 ****
+ static void set_ref_in_list __ARGS((list_T *l, int copyID));
+ static void set_ref_in_item __ARGS((typval_T *tv, int copyID));
+ static void dict_unref __ARGS((dict_T *d));
+! static void dict_free __ARGS((dict_T *d));
+ static dictitem_T *dictitem_alloc __ARGS((char_u *key));
+ static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
+ static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
+--- 433,439 ----
+ static void set_ref_in_list __ARGS((list_T *l, int copyID));
+ static void set_ref_in_item __ARGS((typval_T *tv, int copyID));
+ static void dict_unref __ARGS((dict_T *d));
+! static void dict_free __ARGS((dict_T *d, int recurse));
+ static dictitem_T *dictitem_alloc __ARGS((char_u *key));
+ static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
+ static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
+***************
+*** 4899,4905 ****
+ {
+ if (list_append_tv(l, &item->li_tv) == FAIL)
+ {
+! list_free(l);
+ return FAIL;
+ }
+ item = item->li_next;
+--- 4897,4903 ----
+ {
+ if (list_append_tv(l, &item->li_tv) == FAIL)
+ {
+! list_free(l, TRUE);
+ return FAIL;
+ }
+ item = item->li_next;
+***************
+*** 5299,5305 ****
+ EMSG2(_("E697: Missing end of List ']': %s"), *arg);
+ failret:
+ if (evaluate)
+! list_free(l);
+ return FAIL;
+ }
+
+--- 5297,5303 ----
+ EMSG2(_("E697: Missing end of List ']': %s"), *arg);
+ failret:
+ if (evaluate)
+! list_free(l, TRUE);
+ return FAIL;
+ }
+
+***************
+*** 5363,5370 ****
+ list_unref(l)
+ list_T *l;
+ {
+! if (l != NULL && l->lv_refcount != DEL_REFCOUNT && --l->lv_refcount <= 0)
+! list_free(l);
+ }
+
+ /*
+--- 5361,5368 ----
+ list_unref(l)
+ list_T *l;
+ {
+! if (l != NULL && --l->lv_refcount <= 0)
+! list_free(l, TRUE);
+ }
+
+ /*
+***************
+*** 5372,5385 ****
+ * Ignores the reference count.
+ */
+ void
+! list_free(l)
+! list_T *l;
+ {
+ listitem_T *item;
+
+- /* Avoid that recursive reference to the list frees us again. */
+- l->lv_refcount = DEL_REFCOUNT;
+-
+ /* Remove the list from the list of lists for garbage collection. */
+ if (l->lv_used_prev == NULL)
+ first_list = l->lv_used_next;
+--- 5370,5381 ----
+ * Ignores the reference count.
+ */
+ void
+! list_free(l, recurse)
+! list_T *l;
+! int recurse; /* Free Lists and Dictionaries recursively. */
+ {
+ listitem_T *item;
+
+ /* Remove the list from the list of lists for garbage collection. */
+ if (l->lv_used_prev == NULL)
+ first_list = l->lv_used_next;
+***************
+*** 5392,5398 ****
+ {
+ /* Remove the item before deleting it. */
+ l->lv_first = item->li_next;
+! listitem_free(item);
+ }
+ vim_free(l);
+ }
+--- 5388,5397 ----
+ {
+ /* Remove the item before deleting it. */
+ l->lv_first = item->li_next;
+! if (recurse || (item->li_tv.v_type != VAR_LIST
+! && item->li_tv.v_type != VAR_DICT))
+! clear_tv(&item->li_tv);
+! vim_free(item);
+ }
+ vim_free(l);
+ }
+***************
+*** 6113,6119 ****
+ for (dd = first_dict; dd != NULL; )
+ if (dd->dv_copyID != copyID)
+ {
+! dict_free(dd);
+ did_free = TRUE;
+
+ /* restart, next dict may also have been freed */
+--- 6118,6127 ----
+ for (dd = first_dict; dd != NULL; )
+ if (dd->dv_copyID != copyID)
+ {
+! /* Free the Dictionary and ordinary items it contains, but don't
+! * recurse into Lists and Dictionaries, they will be in the list
+! * of dicts or list of lists. */
+! dict_free(dd, FALSE);
+ did_free = TRUE;
+
+ /* restart, next dict may also have been freed */
+***************
+*** 6130,6136 ****
+ for (ll = first_list; ll != NULL; )
+ if (ll->lv_copyID != copyID && ll->lv_watch == NULL)
+ {
+! list_free(ll);
+ did_free = TRUE;
+
+ /* restart, next list may also have been freed */
+--- 6138,6147 ----
+ for (ll = first_list; ll != NULL; )
+ if (ll->lv_copyID != copyID && ll->lv_watch == NULL)
+ {
+! /* Free the List and ordinary items it contains, but don't recurse
+! * into Lists and Dictionaries, they will be in the list of dicts
+! * or list of lists. */
+! list_free(ll, FALSE);
+ did_free = TRUE;
+
+ /* restart, next list may also have been freed */
+***************
+*** 6223,6233 ****
+ d = (dict_T *)alloc(sizeof(dict_T));
+ if (d != NULL)
+ {
+! /* Add the list to the hashtable for garbage collection. */
+ if (first_dict != NULL)
+ first_dict->dv_used_prev = d;
+ d->dv_used_next = first_dict;
+ d->dv_used_prev = NULL;
+
+ hash_init(&d->dv_hashtab);
+ d->dv_lock = 0;
+--- 6234,6245 ----
+ d = (dict_T *)alloc(sizeof(dict_T));
+ if (d != NULL)
+ {
+! /* Add the list to the list of dicts for garbage collection. */
+ if (first_dict != NULL)
+ first_dict->dv_used_prev = d;
+ d->dv_used_next = first_dict;
+ d->dv_used_prev = NULL;
++ first_dict = d;
+
+ hash_init(&d->dv_hashtab);
+ d->dv_lock = 0;
+***************
+*** 6245,6252 ****
+ dict_unref(d)
+ dict_T *d;
+ {
+! if (d != NULL && d->dv_refcount != DEL_REFCOUNT && --d->dv_refcount <= 0)
+! dict_free(d);
+ }
+
+ /*
+--- 6257,6264 ----
+ dict_unref(d)
+ dict_T *d;
+ {
+! if (d != NULL && --d->dv_refcount <= 0)
+! dict_free(d, TRUE);
+ }
+
+ /*
+***************
+*** 6254,6269 ****
+ * Ignores the reference count.
+ */
+ static void
+! dict_free(d)
+! dict_T *d;
+ {
+ int todo;
+ hashitem_T *hi;
+ dictitem_T *di;
+
+- /* Avoid that recursive reference to the dict frees us again. */
+- d->dv_refcount = DEL_REFCOUNT;
+-
+ /* Remove the dict from the list of dicts for garbage collection. */
+ if (d->dv_used_prev == NULL)
+ first_dict = d->dv_used_next;
+--- 6266,6279 ----
+ * Ignores the reference count.
+ */
+ static void
+! dict_free(d, recurse)
+! dict_T *d;
+! int recurse; /* Free Lists and Dictionaries recursively. */
+ {
+ int todo;
+ hashitem_T *hi;
+ dictitem_T *di;
+
+ /* Remove the dict from the list of dicts for garbage collection. */
+ if (d->dv_used_prev == NULL)
+ first_dict = d->dv_used_next;
+***************
+*** 6283,6289 ****
+ * something recursive causing trouble. */
+ di = HI2DI(hi);
+ hash_remove(&d->dv_hashtab, hi);
+! dictitem_free(di);
+ --todo;
+ }
+ }
+--- 6293,6302 ----
+ * something recursive causing trouble. */
+ di = HI2DI(hi);
+ hash_remove(&d->dv_hashtab, hi);
+! if (recurse || (di->di_tv.v_type != VAR_LIST
+! && di->di_tv.v_type != VAR_DICT))
+! clear_tv(&di->di_tv);
+! vim_free(di);
+ --todo;
+ }
+ }
+***************
+*** 6734,6740 ****
+ EMSG2(_("E723: Missing end of Dictionary '}': %s"), *arg);
+ failret:
+ if (evaluate)
+! dict_free(d);
+ return FAIL;
+ }
+
+--- 6747,6753 ----
+ EMSG2(_("E723: Missing end of Dictionary '}': %s"), *arg);
+ failret:
+ if (evaluate)
+! dict_free(d, TRUE);
+ return FAIL;
+ }
+
+*** ../vim-7.0.134/src/proto/eval.pro Fri Mar 24 23:16:28 2006
+--- src/proto/eval.pro Sun Oct 15 22:08:11 2006
+***************
+*** 44,50 ****
+ extern char_u *get_user_var_name __ARGS((expand_T *xp, int idx));
+ extern list_T *list_alloc __ARGS((void));
+ extern void list_unref __ARGS((list_T *l));
+! extern void list_free __ARGS((list_T *l));
+ extern dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
+ extern int list_append_dict __ARGS((list_T *list, dict_T *dict));
+ extern int garbage_collect __ARGS((void));
+--- 44,50 ----
+ extern char_u *get_user_var_name __ARGS((expand_T *xp, int idx));
+ extern list_T *list_alloc __ARGS((void));
+ extern void list_unref __ARGS((list_T *l));
+! extern void list_free __ARGS((list_T *l, int recurse));
+ extern dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
+ extern int list_append_dict __ARGS((list_T *list, dict_T *dict));
+ extern int garbage_collect __ARGS((void));
+*** ../vim-7.0.134/src/tag.c Sun Sep 10 13:56:06 2006
+--- src/tag.c Sun Oct 15 21:44:56 2006
+***************
+*** 911,917 ****
+
+ set_errorlist(curwin, list, ' ');
+
+! list_free(list);
+
+ cur_match = 0; /* Jump to the first tag */
+ }
+--- 911,917 ----
+
+ set_errorlist(curwin, list, ' ');
+
+! list_free(list, TRUE);
+
+ cur_match = 0; /* Jump to the first tag */
+ }
+*** ../vim-7.0.134/src/version.c Sun Oct 15 15:10:08 2006
+--- src/version.c Sun Oct 15 22:01:53 2006
+***************
+*** 668,669 ****
+--- 668,671 ----
+ { /* Add new patch number below this line */
++ /**/
++ 135,
+ /**/
+
+--
+Well, you come from nothing, you go back to nothing... What have you
+lost? Nothing!
+ -- Monty Python: The life of Brian
+
+ /// Bram Moolenaar -- Bram at 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 ///
More information about the pkg-vim-maintainers
mailing list