From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.bugs Subject: bug#15648: 24.2.50; gnutls SSL connection to IMAP server causes emacs to crash completely Date: Thu, 24 Oct 2013 10:10:08 -0400 Message-ID: <21097.10816.221279.461499@consult.pretender> References: <21089.32240.198931.971000@consult.pretender> <87y55kjayp.fsf_-_@flea.lifelogs.com> <21096.1667.116936.254737@consult.pretender> <83eh7bj1yq.fsf@gnu.org> <87ppqvke5u.fsf@flea.lifelogs.com> <87fvrun1pw.fsf@flea.lifelogs.com> <21093.32992.278229.646703@consult.pretender> <877gd5mo5x.fsf@flea.lifelogs.com> <21094.39055.449629.706850@consult.pretender> <21094.40085.664080.69561@consult.pretender> <21094.52645.645440.977584@consult.pretender> <21094.64459.131668.849138@consult.pretender> <21095.19949.639350.970770@consult.pretender> <21096.24492.292723.589004@consult.pretender> <87eh7bj5no.fsf_-_@flea.lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1382623877 22266 80.91.229.3 (24 Oct 2013 14:11:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2013 14:11:17 +0000 (UTC) Cc: emacs@kosowsky.org, 15648@debbugs.gnu.org To: Ted Zlatanov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 24 16:11:20 2013 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 1VZLd9-0004Ey-UK for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2013 16:11:20 +0200 Original-Received: from localhost ([::1]:54603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLd9-0002vn-Bw for geb-bug-gnu-emacs@m.gmane.org; Thu, 24 Oct 2013 10:11:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLcz-0002nr-4o for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 10:11:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZLcs-0003pP-NL for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 10:11:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55357) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZLcs-0003pG-Iq for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 10:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VZLcs-00083y-6H for bug-gnu-emacs@gnu.org; Thu, 24 Oct 2013 10:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 Oct 2013 14:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15648 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15648-submit@debbugs.gnu.org id=B15648.138262384430967 (code B ref 15648); Thu, 24 Oct 2013 14:11:02 +0000 Original-Received: (at 15648) by debbugs.gnu.org; 24 Oct 2013 14:10:44 +0000 Original-Received: from localhost ([127.0.0.1]:41143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZLcZ-00083P-Qv for submit@debbugs.gnu.org; Thu, 24 Oct 2013 10:10:44 -0400 Original-Received: from vms173011pub.verizon.net ([206.46.173.11]:56727) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZLcW-000837-An for 15648@debbugs.gnu.org; Thu, 24 Oct 2013 10:10:42 -0400 Original-Received: from consult.pretender ([unknown] [72.93.211.25]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MV6004TGFCX4R60@vms173011.mailsrvcs.net> for 15648@debbugs.gnu.org; Thu, 24 Oct 2013 09:10:10 -0500 (CDT) Original-Received: from consult.pretender (consult.pretender [127.0.0.1]) by consult.pretender (8.14.4/8.14.4) with ESMTP id r9OEA8XW012671; Thu, 24 Oct 2013 10:10:08 -0400 In-reply-to: <87eh7bj5no.fsf_-_@flea.lifelogs.com> X-Mailer: VM 8.2.0b under 23.1.1 (i386-redhat-linux-gnu) 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:79585 Archived-At: Ted Zlatanov wrote at about 06:59:39 -0400 on Thursday, October 24, 2013: > On Wed, 23 Oct 2013 19:45:48 -0400 wrote: > Provide a backtrace, please. I promise you we'll consider your proposal > and all the alternatives as soon as we know what's broken. OK... but before I invest in downloading and running a C-debugger, I want to be clear that there are actually 2 bugs here - one at the elisp level and one at the C-level 1. At the elisp level, gnutls.el fails to consistently and appropriately handle (or disable) Magic Files aka file handlers (including in particular, cygwin-mount). Specifically, gnutls-negotiate uses the Magic File associated primitive file-exists-p to test for the existence of a file but then passes off the unmodified (and non-existent) Magic File path (e.g., path relative to cygwin root) to some C-code. Clearly, short of passing nearly the entire Emacs state (including variable & function defs) to the C-code, it is impossible for the C-code to know what file handler to use to translate the Magic File into a system recognizable and valid path. I believe the nature of this bug is fully explored and understood. The solution is to treat Magic files appropriately and consistently either (1) by using the Magic File aware primitive expand-file-name to expand the file name before passing off to the C-code or (2) disabling Magic file handlers (and documenting that fact) 2. At the C-code level, there is a bug in that passing a non-existent/invalid file path may cause the entire Emacs code to crash. It is this bug that requires further C-source debugging to identify the source... > I will gladly make the change to avoid a path like > "/usr/ssl/whatever" that doesn't work in Cygwin, but I don't want > to make that change in order to hide an underlying problem. Again, the issue is broader than just Cygwin paths... the code as-is fails to handle any type of Magic File and associated file handlers... and there is no reason or way for a user to suspect or know that the officially include Emacs library gnutls.el chooses not to handle Magic files correctly -- short of debugging, tracing, and reading the detailed gnutls.el elisp code. Also, as above, there is both a problem in the gnutls.el code AND in the underlying C-code > In other words, if a magic path can break Emacs because of some library > interaction beneath the ELisp code, the fix is *probably* not at the > ELisp level because there are so many potential trigger points for the > bad behavior. Wrong - the opposite is true. Handling of magic files via their associated file handlers can *only* be done generally and properly at the elisp level since short of passing the entire Emacs state to external C-code, there is no way of the C-code knowing how to handle potentially arbitrary file handlers. It's very simple. File access and reference should only be done via Magic File aware primitives. In particular, when passing a path to external C-code, that code should first be translated by something like expand-file-name to system-recognizable and valid paths.