From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Possible fix for crash in NS's tooltip showAtX:Y:for: Date: Thu, 02 May 2013 13:53:22 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1367470417 31547 80.91.229.3 (2 May 2013 04:53:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 May 2013 04:53:37 +0000 (UTC) Cc: Emacs developers To: David Reitter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 02 06:53:36 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UXlWQ-0000mB-AB for ged-emacs-devel@m.gmane.org; Thu, 02 May 2013 06:53:34 +0200 Original-Received: from localhost ([::1]:44433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXlWP-0003qN-Sm for ged-emacs-devel@m.gmane.org; Thu, 02 May 2013 00:53:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXlWM-0003py-BO for emacs-devel@gnu.org; Thu, 02 May 2013 00:53:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXlWK-000551-Mk for emacs-devel@gnu.org; Thu, 02 May 2013 00:53:30 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:57479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXlWK-00053O-6O for emacs-devel@gnu.org; Thu, 02 May 2013 00:53:28 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 083B0C055D; Thu, 2 May 2013 13:53:23 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:159259 Archived-At: >>>>> On Mon, 29 Apr 2013 13:56:49 -0400, David Reitter 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 mituharu@math.s.chiba-u.ac.jp