From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tobias Getzner Newsgroups: gmane.emacs.bugs Subject: bug#20802: Segfault when showing non-GTK+ tooltip Date: Wed, 17 Jun 2015 09:34:47 +0200 Message-ID: <1434526487.8634.10.camel@gmx.de> References: <1434187118.10061.4.camel@gmx.de> <83381wq76d.fsf@gnu.org> <1434439264.2078.6.camel@gmx.de> <558024F4.5090205@gmx.at> <1434468845.21431.2.camel@gmx.de> <83oakfmyq4.fsf@gnu.org> <1434472472.21431.4.camel@gmx.de> <55805D69.2060707@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1434526552 9682 80.91.229.3 (17 Jun 2015 07:35:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Jun 2015 07:35:52 +0000 (UTC) Cc: 20802@debbugs.gnu.org To: martin rudalics , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jun 17 09:35:42 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 1Z57sk-0008QF-IB for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 09:35:34 +0200 Original-Received: from localhost ([::1]:44981 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z57sj-0006CI-LA for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Jun 2015 03:35:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z57sS-0006A8-EJ for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 03:35:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z57sF-00070z-DA for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 03:35:16 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z57sF-00070n-8j for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 03:35:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z57sE-0004Hu-Px for bug-gnu-emacs@gnu.org; Wed, 17 Jun 2015 03:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tobias Getzner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jun 2015 07:35: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.143452649816468 (code B ref 20802); Wed, 17 Jun 2015 07:35:02 +0000 Original-Received: (at 20802) by debbugs.gnu.org; 17 Jun 2015 07:34:58 +0000 Original-Received: from localhost ([127.0.0.1]:56792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z57s9-0004HX-4p for submit@debbugs.gnu.org; Wed, 17 Jun 2015 03:34:57 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:63705) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z57s6-0004HJ-M8 for 20802@debbugs.gnu.org; Wed, 17 Jun 2015 03:34:55 -0400 Original-Received: from glenalbyn.linguistics.ruhr-uni-bochum.de ([134.147.14.84]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MPm54-1ZA5gA2OJe-0052BF; Wed, 17 Jun 2015 09:34:48 +0200 In-Reply-To: <55805D69.2060707@gmx.at> X-Mailer: Evolution 3.16.3 X-Provags-ID: V03:K0:YW9+Euct6aNdKQ8CAuWmJAumhbJtgykGBBa3jg1H3TswPc5xA9Z LQCjvgoA5dZyNqli1TGAAMSsFohjdVmbiuzFk53SfBm2HI7F39ZyuvUTyTkoUt34o+LhjDP N9vFF8iTz18vNqAz1N+nSi2vubuEHoZtJeUMSzQyznS9Q3/HEFtAO/2O7EOympYl6Qhs7Co xPjGnX/nKw4ZIAbZyWfrA== X-UI-Out-Filterresults: notjunk:1;V01:K0:BFnD/goeOTw=:5InYl66lS+UEcx0Y8HV3j7 XE9fJmP1UoiVv02VM3SseT/9eG51JEboIEXL1O+GUykngHM51VgbyA2bZbiRhWt1XCwBrYnBz fQ4o0XlkF/IUIw7Pg0NJ50pP5BBdd/KC8NGulOoqWKNIVSnPLmT9Oiym2+3lutEH/4nYs9VSt UuffazNhA3Kq7h2bWfV+oMlksmekeHrVPFMawHDwbQYbDk101tgzK7toc1xTxRq0r9oxovmoA P0KWI6+Y0Ads09sUNC5H02F6cYN82FFtsw93HJJ5q06lWPlsu3tL6G3EinMMdbwN/YLYI9aH0 Iwsp4+w2cny8VLHDEBkUOiYxXeDqgngWm3SFhY8wlk1S+bmuwpYzxScb1+dPuWWZIaqbivtA8 mWQFG1qsSmSJVyNWnMZqmIiJoqEuiy+zf+bTKdWdKLeo9usMQKgpwt9ImUWefKzb3XOH/H8jS BbTQkMoWPEhWfO9ZXdxWep/LbbKW10V8WW6cUR7tptLxyIZeHT8r6ROVM6bZowX+FUolXGN21 46e7dGoYTGOPFScKsU5242pEMGjyFrre7cnETobfz/DxD8v6Lp9lrxhBbll+9yX1mCcH/yxdd FU79IoZFuAEe/EEsuXLqJ25oO7puBOW+Vj+2YrLHA7TQs1YaqXaL/ua65OqARog4pJA6ijkgZ ba/9M4gcuLuLEkUBdxHHPcp9azp1qb4jwCxo1sBWSB4UoxTU9c3Hct/G6807HZr6tqVI= 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:104013 Archived-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=20 > tooltip > frame? If it isn't, then could you experimentally try to move the >=20 > image_cache_refcount =3D > FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; > #ifdef GLYPH_DEBUG > dpyinfo_refcount =3D dpyinfo->reference_count; > #endif /* GLYPH_DEBUG */ >=20 > block from line 5192 somewhere up in the code, first before line=20 > 5172, > later maybe a bit further up and check whether it helps? I=E2=80=99m not a C guy, so bear with me if I fail to follow your instructi= ons in a sensible way.=20 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 =C2=ABerror while displaying tooltip message=C2=BB, and fell back on showing the tooltip message in the echo area. Below is the state of =C2=ABimage_cache_refcount=C2=BB for a fe= w 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 =C2=ABx_free_frame_resources=C2=BB to make sure everything is solid? Best, TG =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3Ddif= f=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D 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); } =20 + image_cache_refcount =3D + FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; +#ifdef GLYPH_DEBUG + dpyinfo_refcount =3D 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); =20 - image_cache_refcount =3D - FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; -#ifdef GLYPH_DEBUG - dpyinfo_refcount =3D 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. */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D gd= b session =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D35322131,= =20 parms@entry=3D35322003, text=3Dtext@entry=3D33649076) at xfns.c:5172 5172 image_cache_refcount =3D (gdb) p image_cache_refcount $1 =3D 0 (gdb) cont Continuing. Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D35764115,= =20 parms@entry=3D35763987, text=3Dtext@entry=3D33650308) at xfns.c:5172 5172 image_cache_refcount =3D (gdb) cont Continuing. =20 Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D35830499,= =20 parms@entry=3D35830371, text=3Dtext@entry=3D33651252) at xfns.c:5172 5172 image_cache_refcount =3D (gdb)=20 Continuing. Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D35987299,= =20 parms@entry=3D35987171, text=3Dtext@entry=3D33650548) at xfns.c:5172 5172 image_cache_refcount =3D (gdb) p image_cache_refcount $2 =3D 1 (gdb) cont Continuing. Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D19632051,= =20 parms@entry=3D19622915, text=3Dtext@entry=3D34077380) at xfns.c:5172 5172 image_cache_refcount =3D (gdb) cont Continuing. Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D33536019,= =20 parms@entry=3D33536531, text=3Dtext@entry=3D34075236) at xfns.c:5172 5172 image_cache_refcount =3D (gdb) cont Continuing. =20 Breakpoint 1, x_create_tip_frame (dpyinfo=3D0x1722e00, parms=3D34033603,= =20 parms@entry=3D34033971, text=3Dtext@entry=3D34074788) at xfns.c:5172 5172 image_cache_refcount =3D (gdb) p image_cache_refcount $3 =3D 1 (gdb) clear Deleted breakpoint 1=20 (gdb) cont Continuing.