From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.bugs Subject: bug#21641: 25.0.50; Emacs crash on network connection? Date: Thu, 08 Oct 2015 14:46:08 +0900 Message-ID: References: <83bncaeh31.fsf@gnu.org> <3rio6i7fvr.fsf@fencepost.gnu.org> <83a8ruegd6.fsf@gnu.org> <838u7eefkc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1444283251 29011 80.91.229.3 (8 Oct 2015 05:47:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Oct 2015 05:47:31 +0000 (UTC) Cc: larsi@gnus.org, 21641@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 08 07:47:22 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from eggs.gnu.org ([208.118.235.92]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zk430-0007jx-2U for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 07:47:22 +0200 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk42o-0004UG-Bx for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 01:47:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk42o-0004Sy-4s for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 01:47:10 -0400 Original-Received: from localhost ([::1]:60815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk42o-0002eC-2B for geb-bug-gnu-emacs@m.gmane.org; Thu, 08 Oct 2015 01:47:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk42j-0002e5-Sa for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 01:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk42g-0004Ig-CX for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 01:47:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk42g-0004IO-8d for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 01:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Zk42f-0008W6-VV for bug-gnu-emacs@gnu.org; Thu, 08 Oct 2015 01:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daiki Ueno Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Oct 2015 05:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21641 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 21641-submit@debbugs.gnu.org id=B21641.144428319432703 (code B ref 21641); Thu, 08 Oct 2015 05:47:01 +0000 Original-Received: (at 21641) by debbugs.gnu.org; 8 Oct 2015 05:46:34 +0000 Original-Received: from localhost ([127.0.0.1]:59603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zk42D-0008VO-2G for submit@debbugs.gnu.org; Thu, 08 Oct 2015 01:46:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41290) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zk42A-0008VG-GQ for 21641@debbugs.gnu.org; Thu, 08 Oct 2015 01:46:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk426-00049F-Kr for 21641@debbugs.gnu.org; Thu, 08 Oct 2015 01:46:29 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk41w-00047r-Jc; Thu, 08 Oct 2015 01:46:16 -0400 Original-Received: from du-a.org ([219.94.251.20]:38158 helo=dhcp-217-92.nrt.redhat.com) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1Zk41u-0004Rr-AT; Thu, 08 Oct 2015 01:46:14 -0400 In-Reply-To: <838u7eefkc.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 07 Oct 2015 20:47:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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-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 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 Xref: news.gmane.org gmane.emacs.bugs:107430 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Btw, after making this change, I see a lot of error messages from Glib > (called by librsvg), like this: > > (emacs.exe:1624): GLib-CRITICAL **: g_error_free: assertion 'error > != NULL' failed How about using g_clear_error to avoid this kind of g_error_free usage? The function has been there since glib 2.0, so there shouldn't be a compatibility issue. gtkutil.c has similar code reusing GError variable, which could be simplified as well. Regards, -- Daiki Ueno --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-image.c-use-g_clear_error-instead-of-g_error_free.patch >From b2be270bb367d925fce9b53be84771aaeb9691c7 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 8 Oct 2015 12:43:37 +0900 Subject: [PATCH] image.c: use g_clear_error, instead of g_error_free * src/image.c: Define g_clear_error, instead of g_error_free. (init_svg_functions): Resolve DLL function g_clear_error, instead of g_error_free. (svg_load_image): Use g_clear_error, instead of g_error_free. --- src/image.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/image.c b/src/image.c index 10b067f..418c656 100644 --- a/src/image.c +++ b/src/image.c @@ -9004,7 +9004,7 @@ DEF_DLL_FN (int, gdk_pixbuf_get_bits_per_sample, (const GdkPixbuf *)); DEF_DLL_FN (void, g_type_init, (void)); # endif DEF_DLL_FN (void, g_object_unref, (gpointer)); -DEF_DLL_FN (void, g_error_free, (GError *)); +DEF_DLL_FN (void, g_clear_error, (GError **)); static bool init_svg_functions (void) @@ -9042,7 +9042,7 @@ init_svg_functions (void) LOAD_DLL_FN (gobject, g_type_init); # endif LOAD_DLL_FN (gobject, g_object_unref); - LOAD_DLL_FN (glib, g_error_free); + LOAD_DLL_FN (glib, g_clear_error); return 1; } @@ -9058,7 +9058,7 @@ init_svg_functions (void) # undef gdk_pixbuf_get_pixels # undef gdk_pixbuf_get_rowstride # undef gdk_pixbuf_get_width -# undef g_error_free +# undef g_clear_error # undef g_object_unref # undef g_type_init # undef rsvg_handle_close @@ -9076,7 +9076,7 @@ init_svg_functions (void) # define gdk_pixbuf_get_pixels fn_gdk_pixbuf_get_pixels # define gdk_pixbuf_get_rowstride fn_gdk_pixbuf_get_rowstride # define gdk_pixbuf_get_width fn_gdk_pixbuf_get_width -# define g_error_free fn_g_error_free +# define g_clear_error fn_g_clear_error # define g_object_unref fn_g_object_unref # define g_type_init fn_g_type_init # define rsvg_handle_close fn_rsvg_handle_close @@ -9331,7 +9331,7 @@ svg_load_image (struct frame *f, /* Pointer to emacs frame structure. * /* FIXME: Use error->message so the user knows what is the actual problem with the image. */ image_error ("Error parsing SVG image `%s'", img->spec); - g_error_free (err); + g_clear_error (&err); return 0; } -- 2.4.3 --=-=-=--