emacs-devel
[Top][All Lists]
Advanced

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

Re: Possible fix for crash in NS's tooltip showAtX:Y:for:


From: YAMAMOTO Mitsuharu
Subject: Re: Possible fix for crash in NS's tooltip showAtX:Y:for:
Date: Thu, 02 May 2013 13:53:22 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Mon, 29 Apr 2013 13:56:49 -0400, David Reitter <address@hidden> said:

> Suggest to initialize ns_tooltip as shown below.  I've been seeing
> occasional crash reports in Fx_show_tip (and showAtX).  This may be
> the culprit.  (I am not sure if variables in ObjC default to nil all
> the time.)

> --- a/src/nsfns.m
> +++ b/src/nsfns.m
> @@ -88,7 +88,7 @@ Lisp_Object Qfontsize;
>  /* hack for OS X file panels */
>  char panelOK = 0;
 
> -EmacsTooltip *ns_tooltip;
> +EmacsTooltip *ns_tooltip = nil;
 
Objective C is not different from the usual C in this respect (i.e.,
implicit initialization of objects that have static storage duration).
So the above change does not give any effect in theory, because `nil'
is actually a null pointer.

But in practice, it can affect the arrangement of locations of
variables in the executable file.  If this change really avoids a
crash in Fx_show_tip, then that might be a sign of some memory
corruption such as buffer overrun around the original location of
ns_tooltip, and thus this change might cause another problem.

                                     YAMAMOTO Mitsuharu
                                address@hidden



reply via email to

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