From: Tobias Getzner <tobias.getzner@gmx.de>
To: martin rudalics <rudalics@gmx.at>, Eli Zaretskii <eliz@gnu.org>
Cc: 20802@debbugs.gnu.org
Subject: bug#20802: Segfault when showing non-GTK+ tooltip
Date: Wed, 17 Jun 2015 09:34:47 +0200 [thread overview]
Message-ID: <1434526487.8634.10.camel@gmx.de> (raw)
In-Reply-To: <55805D69.2060707@gmx.at>
On Di, 2015-06-16 at 19:31 +0200, martin rudalics wrote:
> Can you try whether my conjecture is true by putting a breakpoint on
> line 5192 and check whether the refcount gets set there for the
> tooltip
> frame? If it isn't, then could you experimentally try to move the
>
> image_cache_refcount =
> FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
> #ifdef GLYPH_DEBUG
> dpyinfo_refcount = dpyinfo->reference_count;
> #endif /* GLYPH_DEBUG */
>
> block from line 5192 somewhere up in the code, first before line
> 5172,
> later maybe a bit further up and check whether it helps?
I’m not a C guy, so bear with me if I fail to follow your instructions
in a sensible way.
After setting a breakpoint at 5192, the segfault would trigger without
the breakpoint kicking in. I then moved that hunk up to line 5172 (diff
below). Now the breakpoint there would kick in, and further, now
segfault would trigger; instead, it gave the «error while displaying
tooltip message», and fell back on showing the tooltip message in the
echo area. Below is the state of «image_cache_refcount» for a few
breaks. I fumbled a bit with the line history and only printed it for
some of the breaks.
Does this address your questions too, Eli, or do you want me to step
into «x_free_frame_resources» to make sure everything is solid?
Best,
TG
========================diff=============================
diff --git a/src/xfns.c b/src/xfns.c
index d066043..2c1c772 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5169,6 +5169,12 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
parms);
}
+ image_cache_refcount =
+ FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
+#ifdef GLYPH_DEBUG
+ dpyinfo_refcount = dpyinfo->reference_count;
+#endif /* GLYPH_DEBUG */
+
x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
"internalBorderWidth", "internalBorderWidth",
RES_TYPE_NUMBER);
@@ -5189,12 +5195,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
x_default_parameter (f, parms, Qborder_color, build_string ("black"),
"borderColor", "BorderColor", RES_TYPE_STRING);
- image_cache_refcount =
- FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0;
-#ifdef GLYPH_DEBUG
- dpyinfo_refcount = dpyinfo->reference_count;
-#endif /* GLYPH_DEBUG */
-
/* Init faces before x_default_parameter is called for the
scroll-bar-width parameter because otherwise we end up in
init_iterator with a null face cache, which should not happen. */
======================== gdb session ======================
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=35322131,
parms@entry=35322003, text=text@entry=33649076) at xfns.c:5172
5172 image_cache_refcount =
(gdb) p image_cache_refcount
$1 = 0
(gdb) cont
Continuing.
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=35764115,
parms@entry=35763987, text=text@entry=33650308) at xfns.c:5172
5172 image_cache_refcount =
(gdb) cont
Continuing.
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=35830499,
parms@entry=35830371, text=text@entry=33651252) at xfns.c:5172
5172 image_cache_refcount =
(gdb)
Continuing.
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=35987299,
parms@entry=35987171, text=text@entry=33650548) at xfns.c:5172
5172 image_cache_refcount =
(gdb) p image_cache_refcount
$2 = 1
(gdb) cont
Continuing.
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=19632051,
parms@entry=19622915, text=text@entry=34077380) at xfns.c:5172
5172 image_cache_refcount =
(gdb) cont
Continuing.
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=33536019,
parms@entry=33536531, text=text@entry=34075236) at xfns.c:5172
5172 image_cache_refcount =
(gdb) cont
Continuing.
Breakpoint 1, x_create_tip_frame (dpyinfo=0x1722e00, parms=34033603,
parms@entry=34033971, text=text@entry=34074788) at xfns.c:5172
5172 image_cache_refcount =
(gdb) p image_cache_refcount
$3 = 1
(gdb) clear
Deleted breakpoint 1
(gdb) cont
Continuing.
next prev parent reply other threads:[~2015-06-17 7:34 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
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 [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1434526487.8634.10.camel@gmx.de \
--to=tobias.getzner@gmx.de \
--cc=20802@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=rudalics@gmx.at \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.