emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGSEGV after mouse-1 on toolbar


From: Gerd Moellmann
Subject: Re: SIGSEGV after mouse-1 on toolbar
Date: 17 Nov 2001 11:45:22 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.50

address@hidden (Pavel Janík) writes:

> I already reported this problem with attached image when the point of
> click was marked with red point. 

Could you please send me that image again, or describe precisely where
you clicked?

> Here is the analyse of the problem, but I do not know the display
> engine of Emacs yet, so maybe this will trigger some idea...

[...]

> #2  0x0811d968 in args_out_of_range (a1=268435455, a2=268435455) at data.c:149

[...]

> #6  0x08066b76 in tool_bar_item_info (f=0x8482fe0, glyph=0x84a1db8, 
>     prop_idx=0xbffd086c) at xdisp.c:7942

That shouldn't happen, and the change below should avoid it, but it
would nevertheless be necessary to see why get-text-property gets
called with an invalid position in the tool bar string.

*** xdisp.c     2001/11/17 10:35:48     1.705
--- xdisp.c     2001/11/17 10:38:15
***************
*** 7935,7945 ****
  {
    Lisp_Object prop;
    int success_p;
    
    /* Get the text property `menu-item' at pos. The value of that
       property is the start index of this item's properties in
       F->tool_bar_items.  */
!   prop = Fget_text_property (make_number (glyph->charpos),
                             Qmenu_item, f->current_tool_bar_string);
    if (INTEGERP (prop))
      {
--- 7935,7952 ----
  {
    Lisp_Object prop;
    int success_p;
+   int charpos;
+ 
+   /* This function can be called asynchronously, which means we must
+      exclude any possibility that Fget_text_property signals an
+      error.  */
+   charpos = min (XSTRING (f->current_tool_bar_string)->size, glyph->charpos);
+   charpos = max (0, charpos);
    
    /* Get the text property `menu-item' at pos. The value of that
       property is the start index of this item's properties in
       F->tool_bar_items.  */
!   prop = Fget_text_property (make_number (charpos),
                             Qmenu_item, f->current_tool_bar_string);
    if (INTEGERP (prop))
      {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]