From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Cochran Newsgroups: gmane.emacs.bugs Subject: bug#24041: 25.1.50; xwidget + -nw mode gives segfault Date: Mon, 22 Aug 2016 11:30:15 -0700 Message-ID: <87k2f87j2g.fsf@cochranmail.com> References: <8760qwtxld.fsf@cochranmail.com> <83oa4ndhfw.fsf@gnu.org> <87lgzrm8ft.fsf@cochranmail.com> <8360qudeuj.fsf@gnu.org> <878tvpa6w6.fsf@cochranmail.com> <83k2f8c1cd.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1471890685 20378 195.159.176.226 (22 Aug 2016 18:31:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 22 Aug 2016 18:31:25 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: shanemhansen@gmail.com, 24041@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 22 20:31:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbu0D-0004rR-KP for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Aug 2016 20:31:18 +0200 Original-Received: from localhost ([::1]:42682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbu0A-0000q8-VK for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Aug 2016 14:31:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbu04-0000pt-RI for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2016 14:31:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbtzy-00013m-Mr for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2016 14:31:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbtzy-00013i-Iz for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2016 14:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bbtzy-0007Q3-Ci for bug-gnu-emacs@gnu.org; Mon, 22 Aug 2016 14:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Cochran Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Aug 2016 18:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24041 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24041-submit@debbugs.gnu.org id=B24041.147189063728489 (code B ref 24041); Mon, 22 Aug 2016 18:31:02 +0000 Original-Received: (at 24041) by debbugs.gnu.org; 22 Aug 2016 18:30:37 +0000 Original-Received: from localhost ([127.0.0.1]:37160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbtzY-0007PQ-C7 for submit@debbugs.gnu.org; Mon, 22 Aug 2016 14:30:36 -0400 Original-Received: from mail.workgrouplinux.net ([207.195.177.82]:35610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbtzS-0007PD-LX for 24041@debbugs.gnu.org; Mon, 22 Aug 2016 14:30:34 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=simple; d=cochranmail.com; h=from:to :cc:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=dkim1; bh=xkRszA0SyOAsNIUunEPh/V4KW4A=; b=2TuKt OKhBSMQcamxQKq6svNssFJTanNPcpO9MoFFC0gl16EFoHm3dCBy4RR+e2jgr7wVg x1tJDDiKBZaTtvvLwj59GI0e71KgbN/Y8AM0zHZ1k1B3PCYj+i75Xe0A4nazx3pk clk0E+5h6w+WzghOPji9le/qM6MjuBdy0XxH/DNTNOeCFOlwv1tB473wWG9VBAUl CPOKCE44FkxlU+bYrJKvfI7RUWBsuUloXYbj5CF7aH7SW4BxqEuYqmQO8AQUpbsK 3byvXpNXx4C1ZVqHmVkbcbeHEwELNcMSqJy7lHMEdzqzdj0d0CXWHfPfjxZBBlZc eP+VunnOeJh8A3hCA== Original-Received: (qmail 1076 invoked by uid 0); 22 Aug 2016 18:30:28 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=private; d=cochranmail.com; b=eJ1Z7VlvBRQsmgcHCwPUmMN7pejnzv9hBS/SOv/4fPY7p09XwvnLlFD5pGeBF0Socgm5wZw3cMiGduWmepHAeg==; Original-Received: from 131-191-86-130.as.clicknet.org (HELO SoraLaptop) (robert@cochranmail.com@131.191.86.130) by mail.cochrantribe.org with ESMTPA; 22 Aug 2016 18:30:28 -0000 In-Reply-To: <83k2f8c1cd.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 22 Aug 2016 17:41:54 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:122517 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Robert Cochran >> Cc: Robert Cochran , shanemhansen@gmail.com, 24041@debbugs.gnu.org >> Date: Sun, 21 Aug 2016 19:12:41 -0700 >> >> Anyways, I have a patch, below, that's my first stab at solving the >> problem. All it does is call `check_x_display_info` with the current >> frame and allows any resulting error signals to propagate back up. >> >> Probably not the most elegant solution, but I'm not entirely clear what >> can and can't be done from within the Emacs C core. Suggestions are very >> welcome. > > My only comment is that you could call check_x_display_info with Qnil > as its argument. I did think about that. But then it arguably does the wrong thing: `check_x_display_info` with `Qnil` only signals an error when there have never been X windows, eg, opening and closing an X window satisfies the check from then on. It no longer crashes in that instance, but I personally don't think that's the right behavior; if my starting frame isn't capable of displaying an xwidget, say so! Hence checking with the current frame. That, of course, is just my opinion. > Otherwise, LGTM, thanks. And I see nothing inelegant in this patch. Thanks for your reassurance! My one gripe about this patch is that I didn't figure out how to kill the buffer after xwidget creation failure (leaving it seems rather ugly IMO), but I just now realized what I can do. As long as it's not considered wrong to kill a mode's buffer on error, would you also consider this patch to go along with it? ----- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Kill-the-webkit-browser-buffer-if-an-error-occurs.patch Content-Description: Kill webkit browser window if error occurs >From e58ed09121969febde5bfc2206c14f4a7806c323 Mon Sep 17 00:00:00 2001 From: Robert Cochran Date: Mon, 22 Aug 2016 11:21:01 -0700 Subject: [PATCH] Kill the webkit browser buffer if an error occurs * lisp/xwidget.el (xwidget-webkit-new-session): kill webkit buffer on error --- lisp/xwidget.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 7a0ca8b..e925c9a 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -427,11 +427,16 @@ xwidget-webkit-new-session xw) (setq xwidget-webkit-last-session-buffer (switch-to-buffer (get-buffer-create bufname))) - (insert " 'a' adjusts the xwidget size.") - (setq xw (xwidget-insert 1 'webkit bufname 1000 1000)) - (xwidget-put xw 'callback 'xwidget-webkit-callback) - (xwidget-webkit-mode) - (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url))) + (condition-case err + (progn + (insert " 'a' adjusts the xwidget size.") + (setq xw (xwidget-insert 1 'webkit bufname 1000 1000)) + (xwidget-put xw 'callback 'xwidget-webkit-callback) + (xwidget-webkit-mode) + (xwidget-webkit-goto-uri (xwidget-webkit-last-session) url)) + ;; On error, remove webkit buffer and resignal + (error (kill-buffer bufname) + (signal (car err) (cdr err)))))) (defun xwidget-webkit-goto-url (url) -- 2.7.4 --=-=-= Content-Type: text/plain ----- Otherwise, with or without the new patch, I have no issues if you have no issues. Thanks, -- ~Robert Cochran GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871 --=-=-=--