Xavier de Gaye wrote:
>
> 2009/7/15 Dominique Pellé:
>> ...
>> I can reproduce it too now, at least using Gnome-2 GUI
>> with Vim-7.2.233 on Linux x86.
>> ...
>
>
> Hi Dominique,
>
> I can reproduce it too and get the following output with Valgrind.
>
> As in the "Vim SEGV after netbeans messes up syntax data structures",
> there is a call to syn_current_attr() followed by a call to
> invalidate_current_state() in the find_replace_cb()
> callback that is invoked from the gui.
> This does corrupt the 'current_state' global structure and shows up
> the next time in_id_list() is called.
>
> The way this was fixed for the netbeans callback, was to queue the
> events instead of invoking the callback from the gui, and to process
> the queue in the idle loop.


I don't know how complicated it is to fix it the way you describe.

But how about simply avoiding recursive calls of the callback
find_replace_cb()?

With the attached patch, I can no longer reproduce the crash
(whereas I could easily reproduce the crash without the patch).
Can you also check whether it works for you?

Perhaps there are other such callbacks that would require the
same fix.

I'm not familiar enough with gtk though to say whether it's OK.
At least the bug is no longer reproducible, but please review it.

Cheers
-- Dominique

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Index: gui_gtk.c
===================================================================
RCS file: /cvsroot/vim/vim7/src/gui_gtk.c,v
retrieving revision 1.30
diff -c -r1.30 gui_gtk.c
*** gui_gtk.c	17 May 2009 14:23:58 -0000	1.30
--- gui_gtk.c	16 Jul 2009 19:34:03 -0000
***************
*** 2958,2963 ****
--- 2958,2968 ----
      gboolean		direction_down;
      SharedFindReplace	*sfr;
      int			rc;
+     static int		busy = FALSE;
+ 
+     if (busy)
+ 	return;
+     busy = TRUE;
  
      flags = (int)(long)data;	    /* avoid a lint warning here */
  
***************
*** 2993,2998 ****
--- 2998,3004 ----
  
      if (rc && gtk_main_level() > 0)
  	gtk_main_quit(); /* make sure cmd will be handled immediately */
+     busy = FALSE;
  }
  
  /* our usual callback function */

Raspunde prin e-mail lui