From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20802: Segfault when showing non-GTK+ tooltip Date: Wed, 17 Jun 2015 19:39:20 +0300 Message-ID: <83bngemgqv.fsf@gnu.org> 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> <55813F99.8070801@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1434559889 11803 80.91.229.3 (17 Jun 2015 16:51:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jun 2015 16:51:29 +0000 (UTC) Cc: tobias.getzner@gmx.de, 20802@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 17 18:51:14 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 1Z5GYF-0003sY-RA for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 18:50:59 +0200 Original-Received: from localhost ([::1]:48125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5GYA-0005a1-9U for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 12:50:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5GXl-0005L6-Pp for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 12:50:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5GXa-00080i-Hc for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 12:50:29 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5GXa-0007z7-8u for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 12:50:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z5GXZ-0001Wq-KY for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 12:50:17 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jun 2015 16:50:17 +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.14345597745666 (code B ref 20802); Wed, 17 Jun 2015 16:50:17 +0000 Original-Received: (at 20802) by debbugs.gnu.org; 17 Jun 2015 16:49:34 +0000 Original-Received: from localhost ([127.0.0.1]:49769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5GWr-0001TC-DP for submit@debbugs.gnu.org; Wed, 17 Jun 2015 12:49:34 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:48607) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5GNE-0001Dt-EM for 20802@debbugs.gnu.org; Wed, 17 Jun 2015 12:39:40 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NQ300I00KTO8J00@mtaout29.012.net.il> for 20802@debbugs.gnu.org; Wed, 17 Jun 2015 19:38:57 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NQ300BT0KWXYX60@mtaout29.012.net.il>; Wed, 17 Jun 2015 19:38:57 +0300 (IDT) In-reply-to: <55813F99.8070801@gmx.at> X-012-Sender: halo1@inter.net.il 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:104038 Archived-At: > Date: Wed, 17 Jun 2015 11:36:25 +0200 > From: martin rudalics > CC: tobias.getzner@gmx.de, 20802@debbugs.gnu.org > > 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. > ‘x-create-frame’ copies the value of the real refcount 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. Why can't we simply move the code that frees the image cache to delete_terminal? There's only one image cache for each terminal, and it's shared by all frames on that terminal, right? And we call delete-terminal when we delete the last frame on the terminal, right?