From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#20802: Segfault when showing non-GTK+ tooltip Date: Wed, 17 Jun 2015 11:36:25 +0200 Message-ID: <55813F99.8070801@gmx.at> References: <1434187118.10061.4.camel@gmx.de> <83381wq76d.fsf@gnu.org> <557C0526.5050607@gmx.at> <831thfri91.fsf@gnu.org> <557C2EF2.5030308@gmx.at> <83vberpv07.fsf@gnu.org> <557C3E1F.6030305@gmx.at> <83twubpt43.fsf@gnu.org> <557D5EE9.7070902@gmx.at> <83h9qapee0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1434533850 31900 80.91.229.3 (17 Jun 2015 09:37:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jun 2015 09:37:30 +0000 (UTC) Cc: tobias.getzner@gmx.de, 20802@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 17 11:37:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Z59mX-0003iP-IQ for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 11:37:17 +0200 Original-Received: from localhost ([::1]:45372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z59mW-0005tV-Rd for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 05:37:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z59mL-0005Xi-Py for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 05:37:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z59mJ-00063o-1w for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 05:37:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z59mI-00063W-VR for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 05:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z59mI-00077c-FJ for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 05:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jun 2015 09:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20802 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20802-submit@debbugs.gnu.org id=B20802.143453379927344 (code B ref 20802); Wed, 17 Jun 2015 09:37:02 +0000 Original-Received: (at 20802) by debbugs.gnu.org; 17 Jun 2015 09:36:39 +0000 Original-Received: from localhost ([127.0.0.1]:56856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z59lu-00076y-W7 for submit@debbugs.gnu.org; Wed, 17 Jun 2015 05:36:39 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:56459) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z59lt-00076i-5i for 20802@debbugs.gnu.org; Wed, 17 Jun 2015 05:36:38 -0400 Original-Received: from [88.117.51.111] ([88.117.51.111]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LsTjw-1Yyihx2JqK-0123Dg; Wed, 17 Jun 2015 11:36:29 +0200 In-Reply-To: <83h9qapee0.fsf@gnu.org> X-Provags-ID: V03:K0:GxT07N9/gitcdx8b5ahY4Ro02cQJIAgX66GHcgHF/+mWUT5EVRL 9yH4H/7iOBk0mvTNaDAhI6p5Et3cO8BUBBYS+LNOdLu4ULRcmLIJzif6LbdOWmriJCrJaoW K98Mfv2S8IPFKaW3dyjV1OHXKXE+d1OxqWx+WPsqdEgGMT9l4YX+HmLCzWORxV6H6FTmE/K bbrWp0t6Txphs+5/dlqFA== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:104016 Archived-At: > Thanks. Now I know why this cannot be reproduced on Windows: this is > bug#17524 coming back to haunt us. That bug was reported on Windows, > I fixed it on Windows, then suggested a similar fix for X, but was > told it didn't help there. > > So now please try making a fix on X similar to commit ebdc80316, and > if that indeed doesn't help with this crash, perhaps some simple > variation of that will. I'm meanwhile quite confident that we cannot fix the problem with refcounts in the first place. Consider the following scenario: First make sure that the *Backtrace* window will pop up on a new frame. Then make sure that you can trigger its creation, for example, by specifying an invalid color as with the present bug. Also let's assume we use a static variable old_refcount as our shadow copy of the "real" refcount. Now the following will happen: (1) x_create_tip_frame copies the current value of the real refcount into old_refcount. (2) The bug triggers and causes Emacs to pop up the *Backtrace* window. =E2=80=98x-create-frame=E2=80=99 copies the value of the real refcou= nt into old_refcount and afterwards increments the real refcount. (3) Now unwind_create_frame will be run for the tip frame we tried to create in (1). old_refcount won't equal the real refcount since the= latter was incremented in (2) so we leave the real refcount alone. Subsequently we decrement the real refcount and the real refcount will no longer reflect the number of frames referencing the object it guards. So IMHO we have to maintain for every object currently guarded by a refcount a list of the frames referencing the object. Or, have each frame keep a pointer to all objects it needs and when deleting a frame look for each object it guards whether at least one other frame exists that guards the same object. Suggestions welcome. martin