unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: tobias.getzner@gmx.de, 20802@debbugs.gnu.org
Subject: bug#20802: Segfault when showing non-GTK+ tooltip
Date: Wed, 17 Jun 2015 19:39:20 +0300	[thread overview]
Message-ID: <83bngemgqv.fsf@gnu.org> (raw)
In-Reply-To: <55813F99.8070801@gmx.at>

> Date: Wed, 17 Jun 2015 11:36:25 +0200
> From: martin rudalics <rudalics@gmx.at>
> 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?





  reply	other threads:[~2015-06-17 16:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13  9:18 bug#20802: Segfault when showing non-GTK+ tooltip Tobias Getzner
2015-06-13  9:38 ` Eli Zaretskii
2015-06-13 10:25   ` martin rudalics
2015-06-13 10:54     ` Eli Zaretskii
2015-06-13 13:24       ` martin rudalics
2015-06-13 14:01         ` Eli Zaretskii
2015-06-13 14:28           ` martin rudalics
2015-06-13 14:42             ` Eli Zaretskii
2015-06-14 11:00               ` martin rudalics
2015-06-14 14:12                 ` Eli Zaretskii
2015-06-15  8:22                   ` martin rudalics
2015-06-15 15:01                     ` Eli Zaretskii
2015-06-15 16:00                       ` martin rudalics
2015-06-15 17:29                         ` Eli Zaretskii
2015-06-16 13:30                           ` martin rudalics
2015-06-16 14:54                             ` Eli Zaretskii
2015-06-17  9:36                   ` martin rudalics
2015-06-17 16:39                     ` Eli Zaretskii [this message]
2015-06-17 18:56                       ` Stefan Monnier
2015-06-18 13:37                       ` martin rudalics
2015-06-18 15:53                         ` Eli Zaretskii
2015-06-18 16:48                           ` martin rudalics
2015-06-18 17:17                             ` Eli Zaretskii
2015-06-18 17:36                               ` martin rudalics
2015-06-18 18:00                                 ` Eli Zaretskii
2015-06-19  6:43                                   ` martin rudalics
2022-04-29 11:45     ` Lars Ingebrigtsen
2022-05-28 10:58       ` Lars Ingebrigtsen
2015-06-16  7:21   ` Tobias Getzner
2015-06-16 13:30     ` martin rudalics
2015-06-16 15:34       ` Tobias Getzner
2015-06-16 15:58         ` Eli Zaretskii
2015-06-16 16:34           ` Tobias Getzner
2015-06-16 17:12             ` Eli Zaretskii
2015-06-16 17:31             ` martin rudalics
2015-06-17  7:34               ` Tobias Getzner
2015-06-17  8:04                 ` martin rudalics
2015-06-17 14:11                   ` Tobias Getzner
2015-06-18 13:37                     ` martin rudalics
2015-06-18 14:09                       ` Tobias Getzner
2015-06-17 16:30                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83bngemgqv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=20802@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    --cc=tobias.getzner@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).